Documentation for /home/davin/idl/socware/

Generated by IDLdoc

single page | use frames     summary     class     fields     routine details     file attributes

general/tplot/

plotxyvec.pro


Procedure: plotxyvec Purpose: Plots a set of arrows on an image generated with plotxy,tplotxy or, plotxyz this is a pretty simple wrapper for the idl arrow routine. The major difference is that this routine stores a history so that you can autoreplot it This routine will take any of the options that the normal arrows routine takes, with one exception. plotxyvec must always use data coordinates. Examples: plotxyvec,xy,dxy plotxyvec,xy,dxy,/grid,multi='2,1' plotxyvec,xy,dxy,/grid,/addpanel,xticks=5 Arguments: xy: an Nx2 array that contains the starting coordinates of the arrows dxy: an Nx2 array that contains the offset from each starting coordinate to the end of the arrow (They argument can be MxNx2 or JxMxNx2 ... the main requirement is that the last dimension be 2) Keywords: noisotropic:Set this keyword if you want the plot to not be isotropic overplot: set this keyword if you want to plot on the last plot and panel that you plotted on addpanel: set this keyword if you want to plot on a new panel within the same plot window as where you last plotted. This will go to the next column first and if it is at the end of a row, to the next row. multi: set this keyword to a string that specifies the layout of panels within a plotwindow. Set this keyword only the first time you call tplotxy for a given plotwindow. Each time you set it, the previous contents of the window will be erased. You can separate the two elements with a variety of different delimiters The first element is columns left to right, the second rows top to bottom. Append an 'r' to the elements to have it reverse the direction of panel application Examples: multi= '2 3' multi= '5r,7' multi=' 1:6r' ..... mmargin(optional, can only be used if multi is also specified): set this keyword to a 4 element array specifying margins to be left around a multipanel plot. Element order is bottom, left, top, right. Margins are specified relative to the overall size of the window: 0.0 is no margin, 1.0 is all margin. e.g. mmargin=[0.1,0.1,0.15.0.1] mtitle(optional, can only be used if multi is also specified): set this keyword to a string to display as a title for a multi panel plot window. This is displayed in addition to any titles specified for individual panels. If the top mmargin = 0, or has not been set then it will be set at 0.05 to allow room for the title. It is not possible to set your own font size for the mtitle. The size is chosen so that as much as possible the title fits in the top margin and is not too long for the window. Setting a larger top mmargin will increase the font size. NB: Size is fixed you are saving your plot to a postscript. If you require more control over the title format try leaving space using mmargin and adding your own text with idl procedure XYOUTS. mpanel(optional, can only be used if multi is also specified): set this keyword to a string to specify which panels in a multipanel window to plot to. This allows you to create non symmetric plot layouts in a multi panel window. mpanel must contain two numbers separated by a comma (col, row) or two ranges indicated with a colon, separated by a comma. Panels are numbered starting at 0, from top to bottom and from left to right. e.g. mpanel = '0,1' will plot to panel in the first column, second row; mpanel = '0:1,0' will create a plot that takes up both the first and second columns in the first row. You cannot plot to a panel if that panel has already been used. Panels in a window are normally filled from left to right, top to bottom. You can use mpanel to place a plot out of this standard sequence. xistime(optional): set this keyword if you want to treat the x-axis as a time axis and use tplot-style time labels [xy]range: The desired range of your plot on a particular axis. By default this routine will not display any arrows that start or end outside this range. Use noclip, nostartclip, nostopclip, or clip. To display clipped arrows. [xy]margin: The desired margin for the plot on the left/right(x) axis or the top/bottom(y) axis. This is specified as a proportion of the overall plot window.(ie from 0.0 to 1.0) grid: Set this option to draw a grid on the output window: Set a specific window number to plot in. [xy]size: The size in pixels of the window you want to plot wtitle: The title of the window uarrowside: A string storing the side on which the unit arrow should be drawn. Can be: 'left','right','top','bottom','none' uarrowoffset: The distance of the arrow from the edge of the plot. This is specified as a proportion of the size of the plot. (By default it is .2 for left/right arrows and .05 for top/bottom arrows uarrowtext: Any text to be drawn after the number of data units the arrow represents. This is usually used to indicate the units. uarrowdatasize: The number of data units that the unit arrow should represent. arrowscale: The ratio between the coordinate system of the start points(xy) and the coordinate system of the offsets.(dxy) (default:1.0) xtick_get,ytick_get: These behave exactly as the plot command versions, but they had to be identified explictly to ensure they would be passed through correctly. hsize: This scales the head size of the arrow. This is basically like the hsize argument to arrow, except it is a normalized value instead of a fraction of !D.x_size. clip: allows the user to set clipping to a particular bounding box. either set /clip to clip to the current x,y range or set clip equal to q a 4 element array with elements [x0,y0,x1,x2] specifying the corners of the bounding box startclip: clip xy, but not dxy stopclip: clip dxy, but not xy color: Set the color of the arrows. Can use color indexes or letters('b','g'...) This does not currently allow you to set separate colors for separate arrows in a single call. Replot: For internal use only All Other Keywords: See IDL documentation for arrow.pro,plot.pro, this routine accepts most of the arguments to these routines through _extra get_plot_pos=get_plot_pos: Return the normalized position of your plot. Output will be a 4-element array [x1,y1,,x2,y2] Where (x1,y1) is the lower-left corner of your plot and (x2,y2) is the top right corner of your plot. Notes: If the arrows are overplotted, the routine will use the x,y range of the previous plot, by default. The unit arrow will only be drawn automatically when using isotropic plots. If you'd like the routine to draw two unit arrows when using nonisotropic plots, to indicate the scaling in each direction, please request the feature. Arrows that start or end outside of the user defined xrange,yrange will be clipped by default. Use noclip, nostartclip, nostopclip, or clip. Clipping clips the apparent range. So if the arrows are enlarged by uarrowscale, they may be clipped; even if the data values they represent are in range. ******************************** Plot windows and panels: using, /overplot,/addpanel,/noisotropic and multi= To put multiple panels in a window first call plotxy with the multi keyword. It will either plot in which ever window is your current one, or create a new one if no window exists or if you request the use of a nonexistent window. During this first call you may want to specify things like wtitle,xsize,ysize,window...in addition to your normal plotting options. However,Calling window options will interfere with the creation of postscripts. multi specifies the plot window panel layout. So if you set multi='3,2' you will get 6 plots in your window with a layout like: ------- |x x x| |x x x| ------- Each panel will have dimensions x number of pixels = 1/3 * xsize of window and y number of pixels = 1/2 * ysize of window. Your first call should also specify the layout of your first panel. To add to that panel use the /overplot keyword. When you use the /add keyword the program will move on to the next panel within the plot window and you should add options to specify the layout of that panel. If you set the xmargin or ymargin keyword the margin will be relative to the overall size of that panel. When using the not using the noisotropic keyword the procedure will make each axis vary over the same range AND make the largest possible square window given the size of the panel and the sizes of the margins you have provided, if possible. In some cases when ranges are set explictly the plot must be rectangular. An entire plot window must be filled in sequence, if you move on to a new window you will not be able to go back to the previous window without restarting. If you call plotxy with no arguments it will redraw the entire window including all panels and overplots. If you resize the window before calling with new arguments it will redraw the isotropic panels as the largest possible squares. This comes at a cost of storing copies of the commands and data you made in memory. If you need to save memory you can call the function with the /memsave argument, but then redraws will be done using hardware and window resizes can distort isotropic plots. NOTE TO PROGRAMMERS: Information about plotting for plotxy is stored in the global variable !TPLOTXY, this includes information about the layout of the plot window which panel it is currently working on, and the sequence of commands used to generate current plot window so that it can regenerate the plotwindow when called with no arguments. This variable also stores information used by the plotxyz function so spectrographic xyz plots can be interleaved with xy line plots. See Also: plotxy.pro,tplotxy.pro,plotxyz.pro,plotxylib.pro $LastChangedBy: pcruce $ $LastChangedDate: 2013-08-23 17:25:01 -0700 (Fri, 23 Aug 2013) $ $LastChangedRevision: 12887 $ $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/tplot/plotxyvec.pro $

Routines

Routines from plotxyvec.pro

makeunitarrow, dsize, ascale, isotropic, uarrowside, uarrowoffset, uarrowtext, charsize=charsize, charthick=charthick, font=font, _extra=_extra
plotxyvec, xy, dxy, noisotropic=noisotropic, addpanel=addpanel, overplot=overplot, multi=multi, mmargin=mmargin, mtitle=mtitle, mpanel=mpanel, xrange=xrange, yrange=yrange, xmargin=xmargin, ymargin=ymargin, grid=grid, window=window, xsize=xsize, ysize=ysize, wtitle=wtitle, uarrowside=uarrowside, uarrowoffset=uarrowoffset, uarrowtext=uarrowtext, uarrowdatasize=uarrowdatasize, arrowscale=arrowscale, hsize=hsize, clip=clip, startclip=startclip, stopclip=stopclip, color=color, replot=replot, xistime=xistime, get_plot_pos=get_plot_pos, _extra=_extra

Routine details

top source makeunitarrow

makeunitarrow, dsize, ascale, isotropic, uarrowside, uarrowoffset, uarrowtext, charsize=charsize, charthick=charthick, font=font, _extra=_extra

Parameters

dsize
ascale
isotropic
uarrowside
uarrowoffset
uarrowtext

Keywords

charsize
charthick
font
_extra

top source plotxyvec

plotxyvec, xy, dxy, noisotropic=noisotropic, addpanel=addpanel, overplot=overplot, multi=multi, mmargin=mmargin, mtitle=mtitle, mpanel=mpanel, xrange=xrange, yrange=yrange, xmargin=xmargin, ymargin=ymargin, grid=grid, window=window, xsize=xsize, ysize=ysize, wtitle=wtitle, uarrowside=uarrowside, uarrowoffset=uarrowoffset, uarrowtext=uarrowtext, uarrowdatasize=uarrowdatasize, arrowscale=arrowscale, hsize=hsize, clip=clip, startclip=startclip, stopclip=stopclip, color=color, replot=replot, xistime=xistime, get_plot_pos=get_plot_pos, _extra=_extra

Parameters

xy
dxy

Keywords

noisotropic
addpanel
overplot
multi
mmargin
mtitle
mpanel
xrange
yrange
xmargin
ymargin
grid
window
xsize
ysize
wtitle
uarrowside
uarrowoffset
uarrowtext
uarrowdatasize
arrowscale
hsize
clip
startclip
stopclip
color
replot
xistime
get_plot_pos
_extra

File attributes

Modification date: Thu Feb 13 16:43:16 2014
Lines: 344