NRAO Home > CASA > CASA Toolkit Reference Manual
sd.plotter.set_legend - Function

5.1.8 Specify a mapping for the legend
Description

Specify a mapping for the legend instead of using the default indices.

The list of legends should be given to the mp argument as a string. This should have the same length as the number of elements on the legend and then maps to the indeces in order. It is possible to uses latex math expression. These have to be enclosed in r”, e.g. r’$x^{2}$’

The mode argument controls where to display the legend. It should be specified as an integer. The following list shows a meaning of each integer.

0:auto
1:upper right
2:upper left
3:lower left
4:lower right
5:right
6:center left
7:center right
8:lower center
9:upper center
10:center

Arguments





Inputs

mp

A list of legend strings

allowed:

string array

Default:

None

fontsize

The font size of the label

allowed:

integer

Default:

None

mode

Where to display the legend

allowed:

integer

Default:

0 (auto)

refresh

If True, the plot is replotted based on the new parameter setting(s)

allowed:

bool

Default:

True





Returns

Example

         # If the data has two IFs/rest frequencies with index 0 and 1  
         # for CO and SiO:  
         sd.plotter.set_stacking(’i’)  
         sd.plotter.set_legend([’CO’,’SiO’])  
         sd.plotter.plot()  
         sd.plotter.set_legend([r’$^{12}CO$’, r’SiO’])


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