NRAO Home > CASA > CASA Toolkit Reference Manual
msplot.plotoptions - Function

1.3.3 Set the style of the plot.


Description

Set the style of the plot. This function allows the plot title, axis labels, font, plotting color, plot symbol and many, other aspects of the plot to be set by the user, giving the user much flexibility over the look of their plots.

The various aspects that can be controlled by the user are as follows:

Arguments





Inputs

subplot

Three (or four) digits number: first digit for nx, second for ny, the rest for pannel number.

allowed:

int

Default:

111

plotsymbol

String specifying the colour to plot in, as well as the symbol to plot. This argument takes the same values as pylab plot command. Some of the valid symbols are: ’o’, ’+’, ...

allowed:

string

Default:

plotcolor

String specifying the colour to plot in. This can be one of the predefined pylab colour names. This over-rides the colour specified in plotsymbol.

allowed:

string

Default:

multicolor

chan: means different channels in different colours, corr: means different correlations in different colours, both: means different correlations and channels in multicolour none: plot everything the same color.

allowed:

string

Default:

none

plotrange

Plot data within the specified range of values will be plotted. The range of values is given as a string in the form [xmin, xmax, ymin, ymax]. For most plots the xmin/max and ymin/max values are expected to be numeric values. However, for time plots, ie. where one or more of the axis is time, the xmin/max and ymin/max are expected to be strings in the from YYYY/MM/DD/hh:mm:ss.

allowed:

string

Default:

timeplot

Indicate if the data is to be interpretted as time time values. Valid values are ’o’ff, ’x’-axis, ’y’-axis, ’b’oth axes. .

allowed:

char

Default:

’o’

markersize

Specify the size (in pixels) of the markers being plotted. Markers are specified with the plotsymbol option. .

allowed:

double

Default:

8.0

linewidth

Occasionally lines, rather then points, are plotted. This option allows the width of the plotted lines to be specified in points (pixels).

allowed:

double

Default:

1.0

overplot

To do overplot or not.

allowed:

bool

Default:

false

replacetopplot

true : when overplot=false, replace the top-most layer only false : overplot=false always creates a fresh stack of plots.

allowed:

bool

Default:

false

removeoldpanels

true : mimic the native matplotlib behaviour of clearing up plots that lie partially or completely underneath a new panel. false : turn this feature off. Explicit mp.clearplot will then be required. This is provided to allow small plots to be inset into larger plot panels.

allowed:

bool

Default:

true

skipnrows

Indicates how many points to skip when plotting, ie. it plots every nth point.

allowed:

int

Default:

1

averagenrows

Indicates how many rows to average when plotting, ie. average together every n rows.

allowed:

int

Default:

1

extendflag

A string contains flag extension code. Possible codes are: ”P” for correlation; ”C” for channel; ”B” for baseline; ”W” for spectral window; and ”T” for time.

allowed:

string

Default:

connect

Indicates how to join point with lines when plotsymbol contains ’-’. connect=’none’: points are not connected by lines. connect=’row’ : points are joined along time and baseline and each channel and correlation is a separate line. connect=’chan’: points are joined along channel. Each timestamp or baseline is a separate line. This is to be used in conjunction with ’averagenrows’ or ’skipnrows’ because for a large number of rows, it is inefficient.

allowed:

string

Default:

none

showflags

Indicates whether or not to plot flagged and unflagged data. False : plot only unflagged data True : plot only flagged data

allowed:

bool

Default:

false

title

string for the title of the plot

allowed:

string

Default:

xlabel

string for the X -label of the plot

allowed:

string

Default:

ylabel

string for the Y -label of the plot

allowed:

string

Default:

fontsize

font size of the labels for the plot

allowed:

double

Default:

14.0

windowsize

window size of the plot

allowed:

double

Default:

1.0

aspectratio

aspect ratio of the window size of the plot

allowed:

double

Default:

1.0

Returns
bool

Example

 
# open a MS dataset, set the plot options.  
# Also set the X and Y axes labels, and the title,  
  mp.open( msname=’./data/3C273XC1.ms’);  
  labels := [’Amplitude vs UVdist’,’uvdist’,’amplitude’];  
  mp.plotoptions( windowsize=5,aspectratio=0.8, fontsize=14.0, \  
       xlabel=’uvdist’, ylabel=’amplitude’, title=’Amplitude vs. UVdist’,  
       plotsymbol=’g+’ );  
 
# Create 3 panels for plotting, and starting an iterative plot.  Three  
# plots will be plotted for each iteration of the plot.  
mp.open( ’./data/ngc5921.ms’)  
mp.plotoptions( subplot=311 )  
mp.vischannel( column=’data’, what=’amp’, iteration=’baseline’ )  
 
# Create 3 panels for plotting, but they are different sizes.  
# Two panels at the top, smaller with the array and uvcoverage plots.  
# A single wider panel at the bottom (the whole second row) containing  
# the uvdistance plot.  The uvdistance plot, plots the corrected data  
# overtop of the actual data.  
mp.open( ’./data/ngc5921.ms’);  
mp.plotoptions( subplot=221 );  
mp.array();  
mp.plotoptions(subplot=222);  
mp.uvcoverage();  
mp.plotoptions( subplot=212 );  
mp.uvdist();  
mp.plotoptions( overplot=1, plotcolor=3);  
mp.uvdist(column=’corrected_data’);  
 
# Plot the flagged and unflagged data on the same plot, plotting the  
# visibility amplitude vs. the channel.  
mp.open(ngc5921PATH);  
mp.vischannel();  
mp.plotoptions( showflags=1, overplot=1 );  
mp.vischannel();  

__________________________________________________________________


More information about CASA may be found at the CASA web page

Copyright 2016 Associated Universities Inc., Washington, D.C.

This code is available under the terms of the GNU General Public Lincense


Home | Contact Us | Directories | Site Map | Help | Privacy Policy | Search