-
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.