|
|||
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:
-
Labels:
The
title
that
appears
at
the
top
of
the
plot
is
controlled
by
the
paramete’r.
The
label
along
the
x-axis
and
y-axis
are
set
using
the
xlabel
and
ylabel
parameters.
If
no
values
are
not
provided
by
the
user
then
these
labels
are
constructed
from
the
data
selected
to
be
plotted.
To control the font size of the labels use the font parameter. The x-axis and y-axis labels are always set to be 2pts. smaller then the title, which is set at the given font size specified.
-
Size
Controls:
To
control
the
size
of
the
window,
the
windowsize,
and
aspectratio
options
can
be
set.
To control the range of points plotted use the plotrange option. This plot option accepts either time strings in the form YYYY/MM/DD/hh:mm:ss or real values.
-
Data
Point
Sytles:
There
are
a
number
of
plotoptions
for
controlling
the
color
and
style
of
the
points
plotted.
The plotsymbol option set both the color and/or shape of the points plotted. It accepts the same syntax as that used by the pylab plot function. There are six different colors used: ’k’ black, ’r’ed, ’g’reen, ’b’lue, ’c’yan, ’y’ellow, wnd ’w’hite. The plotsymbols include, but are not limited to ’+’, ’o’, ’-’, and ’–’. For a full list see the
matplotlib documentation.
The markersize and linewidth options control how big the plot symbols/lines are.
The multicolor plot option is unique to CASA. It is used to specify whether or not different channels/correlations are plotted in different colors. The colors used can not be set by anyof the plot options. Basically, when plotting the colors are cycled through, changing whenever a different channel or correlation is encountered.
For large measurement sets it may be useful to plot only a portion of the measurment set. The skipnrows allows every nth row to be plotted rather then all of the plots.
-
Multiple
plots:
One
of
the
more
useful
abilities
of
the
CASA
plotters
is
the
ability
to
plot
several
plot
simultaneously,
either
side-by-side,
and/or
one
on
top
of
the
other.
The subplot option determines the number of panels to create, each panel contains a plot of some data. Although the subplot option is a single integer, it is really treated as three separate integers:
- nrows: number of rows of panels,
- ncols: number of columns of panels, and
- panel: the panel number, which panel to plot on.
For example, subplot=132 specifies that there are three panels side-by-side (three columns of panels), and that we are plotting on the second panel. The top, left corner panel is panel number 1, and the panel number increases to the right first, continuing on the next row when the end of a row is reached. The example section shows some examples that create a number of different panel arrangements.
Related to the multi-panel plots is the removeoldpanels option. This option when set to True, the default value, mimics the native matplot behviour, clearing any panels that lie partially or completely under a new panel being plotted. If it is set to False new panels could potentially plot overtop of old panels depending on the subplot values.
In addtions to having plots there is the ability to overplot. The overplot option when set to true will, instead of clearing the panel that is currently being plotted on, plot over what is already there. When overplot is set to true the next plot is plotted over top of what is already there, and if the plotsymbol has not been specified the msplot tool will automatically pick a different color to plot with. An example where this may be useful if plotting different spectral windows separately, but on the same plot.
Related to overplotting is the replacetopplot and showflags option. By default replacetopplot is set to False, but if it is set to True then only the last plot on a panel is replaced. This option comes in handy when a mistake has been made in the last plot. If the showflags option is set to True then the flagged data is plotted. A nice feature is the ability to plot the flagged and unflagged data on the same plot, by doing the same plot with both the overplot and showflags plot turned on. Note that flagged data is always plotted in a magenta color.
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 |
|
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