Skip to content

scripting.plotcommand

Jeremy Faden edited this page Mar 1, 2020 · 10 revisions

Plot Command

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.

Basic Usage

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"

Position by index

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.

Arbitrary position

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%' )

Keywords (also known as named parameters)

Jython name/value pairs allow control over how the data is plotted.

Table Of Contents

URIs that Point to Data Files

Download a CDF and Plot it with Autoplot

Load a CDF directly from a website

URIs that Point to Data Servers

Saving to vap files

Loading vap files

Data Sources

CDF Files

HDF/NetCDF Files

Aggregation

CDAWeb

HAPI Servers

Exporting Data

Export Types

Additional controls

Aggregation

Tools

PNGWalk Tool

Data Mash Up

Events List

Run Batch

Advanced Topics

TimeSeriesBrowse and other Capabilities

Events Lists

Caching

Autoranging

Managing Autoplot's Data Cache

Using Autoplot with Python, IDL, and Matlab

Reading data into Python

Reading data into IDL

Reading data into Matlab

QDataSet Data Model

Clone this wiki locally