-
Notifications
You must be signed in to change notification settings - Fork 0
scripting.plotcommand
The plot command is modeled off of the plot command from IDL, providing a similar interface. These try to initialize the plot in a configuration which would give an appearance similar to if it were just entered in the address bar, and it is then interactive like any other Autoplot plot. This command is also used to create any of Autoplot's render types, such as spectrograms and lineplots.
command | description |
---|---|
plot( uri, title='my plot' ) |
plot the URI held in the string "uri", just as if it were entered in the address bar. Title is reset. |
plot( ds, title='my plot' ) |
plot the data in the symbol "ds" |
One can quickly create a plot containing multiple plots by including an integer position for the first argument:
plot( 0, 'vap+cdaweb:ds=OMNI2_H0_MRG1HR&id=DST1800&timerange=Oct+2016', title='DST' )
plot( 1, 'vap+cdaweb:ds=OMNI2_H0_MRG1HR&id=KP1800&timerange=Oct+2016', title='KP' )
If a .vap file is loaded, the index will be the index of the data which is replaced. Often a .vap is loaded and then the script loads particular data. For example:
setLayout(2,2)
plot( 0, 'vap+cdaweb:ds=OMNI2_H0_MRG1HR&id=DST1800&timerange=Oct+2016', title='DST' )
plot( 1, 'vap+cdaweb:ds=OMNI2_H0_MRG1HR&id=KP1800&timerange=Oct+2016', title='KP' )
plot( 2, 'vap+cdaweb:ds=OMNI2_H0_MRG1HR&id=T1800&timerange=Oct+2016', title='Temperature' )
plot( 3, 'vap+cdaweb:ds=OMNI2_H0_MRG1HR&id=N1800&timerange=Oct+2016', title='Density' )
Note, reset() returns to the original state, and often scripts start with a reset() command.
One can directly position plots on the canvas using xpos and ypos keywords. These are like normalized coordinates, but also have offsets allowing room for labels.
plot( 'vap+cdaweb:ds=OMNI2_H0_MRG1HR&id=DST1800&timerange=Oct+2016', xpos='20%,80%', ypos='0%,40%-2em' )
plot( 'vap+cdaweb:ds=OMNI2_H0_MRG1HR&id=DST1800&timerange=Oct+2016', xpos='20%,50%-2em', ypos='0%,40%-2em' )
plot( 'vap+cdaweb:ds=OMNI2_H0_MRG1HR&id=DST1800&timerange=Oct+2016', xpos='50%+2em,80%', ypos='40%+2em,100%' )
Jython name/value pairs allow control over how the data is plotted.
named color, RBG value, or Color enumeration. Examples include 'DarkRed', '0x00FF00', and Color.GREEN.
command | description |
---|---|
'DarkRed' | One of 140 or so X11 Named Colors |
0x00FF00 | RRGGBB in hexadecimal. |
Color.GREEN | color object |
the size of the symbols, in pixels roughly, of the symbols.
the thickness of the connecting lines, in pixels.
enumeration of values, one of: solid,none,dotfine,dashfine
the plot symbol, one of: dots triangles cross
the method for filling or not filling the symbol center, one of 'none', 'solid', or 'outline'. (Note this is not saved in .vap files.)
label for the legend box.
title for the plot
axis labels.
axis ranges, e.g. '0 to 50' or '2016-01-01'
values to use for tick positions. Use array of strings for times. "+20" will place a tick every twenty units. For times, one can say, as examples: "+4hr" will place a tick every four hours, also "+5days" and "5yr"
special string for the autoranging. Some examples include:
- includeZero=T
- widths=100,1000,10000 to constrain the width to one of the options. These can be ampersand-delimited to combine hints, like so: yautoRangeHints='includeZero=T&widths=100,1000'
- data-to-pixel ratio.
This explicitly sets the renderType, to one of the values: scatter, colorScatter, series, nnSpectrogram, spectrogram, contour, fillToZero, stairSteps, hugeScatter, polar, bounds, digital, stackedHistogram. Further, and to support custom render types, a greater than symbol can be used to pass a control string to the renderer code. For example, "spectrogram>colortable=red_white_blue"
override horizontal position of plot, eg. '50%+1em,100%-2em'
override vertical position of plot, eg. '0%+1em,25%-2em', 0 is top
the row or rowId of the row to use.
the column or columnId of the column to use.
False turns off the x or y tick labels for the plot