Kim Tolbert 28 Nov 2012
Note: This documentation is not complete. It is a work in progress.
In the following examples, p is the plotman object reference.
p = plotman()
Or when you have an xyplot, utplot, specplot, or map object, just call
xyplot_obj -> plotman
To return the plotman object reference (e.g. to send more plots to same plotman instance):
xyplot_obj -> plotman, plotman_obj=p
PLOTMAN method call | Returned value |
z = p->get(/xyz) | Value of xyz control parameter (any of parameters in plotman_plot_control__define or in plotman properties (list at bottom of plotman__define) |
current_panel_number = p->get(/current_panel_number) | Current panel number |
current_panel_desc = p->get(/current_panel_desc) | Current panel description |
current_panel_struct = p->get(/current_panel_struct) | Structure
with all of the information for the current panel, e.g.
help,current_panel_struct
|
panel = p->desc2panel(panel_desc) | Pointer
to panel structure matching panel description
Optional
keywords: |
desc = p->get(/all_panel_desc) | String array containing the panel description for all panels. |
panel_types
= p->get(/all_panel_plot_type) |
String array containing the plot type for all panels: image, xyplot, utplot, or specplot |
panels = p->get(/panels) | Linkedlist
object that contains all the information for all the panels.
Use get_count method to see how many panels are stored, get_item
method to get info for a panel, e.g.
print, panels->get_count()
|
panel_times = p->get_panel_times(panel_numbers) | Time
intervals for each panel specified.
panel_times = p->get_panel_times([2,3,4])
|
axis = p->getaxis( [/ut, /xaxis, /yaxis) | Axis requested. Use one of these keywords: /ut, /xaxis, /yaxis. This doesn't work for all saved object types (like map?). |
0->set,xyz=value | Set plotman parameter xyz to value. |
p->select | If currently selected panel is valid, then sets and shows the window corresponding to that panel, and restores the plot control for that panel. If you want to add to a plot or replot it, you must call select first. |
p->plot | Plot currently selected panel. Can pass in any values stored in plot_control as keywords. |
p->unselect | Unset focus and plot options from current panel (basically call wset,-1 and cleanplot) so that any non-plotman plot a user draws does not show up in plotman window, and has a default set of plot parameters. |
p->show_panel, panel_numbers=panel_numbers | Display
panels with numbers panel_numbers in plotman. Optional
keywords:
; maximize -
display panel panel_number |
p->delete_panel, panel_number=panel_number | Delete
panel pnael_number. Optional keywords:
current - if
set, delete current panel |
p->reset_panel_pc, struct, panels=panel_mask | Modify
the plot control structure saved in panels specified by panel mask
(i.e. panel_mask is an array of 0s and 1s, to change fourth panel,
call with panels=[0,0,0,1]) struct is a structure containing the items in plot control to change. For example to change the color table to table 5 for panels 0,1,2: p->reset_panel_pc, {colortable: 5}, panels=[1,1,1] Or to change the red,green,blue arrays to prefilled arrays in r,g,b: p->reset_panel_pc,{red: r, green:g, blue: b}, panels=[1,1,1] |
p->create_plot_file |
Creates a plot file from the current panel. Keywords:
ps - if set, create PostScript file For PostScript plots: Examples: To plot PS in
portrait mode: |
Plotman reserves 17 slots at the top end of its stored colortable for discrete colors. For each panel, plotman stores three 256 element byte arrays - rcolors, gcolors, and bcolors. The red, green, blue arrays corresponding to the user's choice of colortable are compressed into the first 239 spaces in the rcolors, gcolors, bcolors arrays and the top 17 slots always contain the same discrete colors. The names and indices of those discrete colors can be retrieved as follows:
c=p->get(/color_names)
IDL> help,c,/st
** Structure PLOTMAN_COLOR_NAMES, 17 tags, length=34, data length=34:
VIOLET 239
LIME 240
BLACK 241
MAROON 242
RED 243
PINK 244
ORANGE 245
YELLOW 246
OLIVE 247
GREEN 248
DKGREEN 249
CYAN 250
BLUE 251
DKBLUE 252
MAGENTA 253
PURPLE 254
WHITE 255
In the GUI, users select the colortable through the Plot Control / Image Display Options widget. To change colors at the command line, users can either set the colortable number, or set the red, green, and/or blue arrays. In either case, the colors will be compressed to the first 239 space in the stored plotman color table. e.g.
p->set,colortable=5
or
p->set,red=indgen(256)
To replot a panel with the new colors, a second select must be called before plotting, i.e.
p->select
p->set,colortable=6
p->select
p->plot
Colors:
COLORS | |
red | |
green | |
blue | |
colortable | |
To retrieve the data object stored for the second panel in plotman:
panels=p->get(/panels) ; returns a linkelist object with panel
information
print,panels->get_count() ; prints number of panels stored
p1 = panels->get_item(1) ; gets second panel stored (0 is first)
saved_data = (*p1).saved_data
dobj = *saved_data.data
omap=obj_new('map')
for k=0,3 do
omap->setmap,k,make_map(100*randomn(seed)*dist(64),id=string(k))
;first plot all four objects with color table 3
loadct,3
tvlct,r,g,b,/get
for k=0,3 do omap->plotman,k,plotman=p,red=r,green=g,blue=b
; now get r,g,b arrays for color table 5, and replace the first and
second panels with that color table
loadct,5
tvlct,r,g,b,/get
for k=0,1 do omap->plotman,k,plotman=p,red=r,green=g,blue=b,
nodup=0, /replace
; now get r,g,b arrays for color table 32 and use reset_panel_pc to
change the saved colors for the third and fourth panels and replot
all 4 panels
loadct,32
tvlct,r,g,b,/get
p->reset_panel_pc, {red:r, green:g, blue:b}, panels=[0,0,1,1]
p->show_panel, /all, nacross=2
; now use reset_panel_pc to change the saved color table for the
second panel 2 to color table 5 and replot all 4 panels
p->reset_panel_pc, {colortable: 5}, panels=[0,1]
p->show_panel, /all, nacross=2
; This part just sets up a 2,10 time array and arrays for y1 and y2
and their corresponding error arrays
t = anytim('12-sep-2012 10:00') + findgen(12)*10.d
t=get_edges(t,/edges_2)
y1=findgen(10) & y2=findgen(10)+2.
y1_err=fltarr(10) + .5 & y2_err=fltarr(10) + 1.
; create utplot object using plotman
ut_obj = obj_new('utplot', t, [[y1],[y2]], [[y1_err],[y2_err]])
ut_obj->set,dim1_ids=['y1 data', 'y2 data'], id='Using utplot
object', data_unit='y units'
ut_obj->plotman,desc='testerr'