A package to generate Postscript plots with IDL
Developer Documentation

.
singleplot.pro

Last modification date:
Sat May 11 11:42:47 2013
Statistics:
1117 lines of code

SINGLEPLOT

procedure SINGLEPLOT, psname[, v1][, v2][, v3][, v4][, v5][, v6][, v7][, v8][, v9][, v10][, v11][, v12][, v13][, v14][, v15][, v16][, v17][, v18][, v19][, v20][, v21][, v22][, v23][, v24][, v25][, v26][, v27][, v28][, v29][, v30][, v31][, v32][, v33][, v34][, v35][, v36][, v37][, v38][, v39][, v40][, v41][, v42][, v43][, v44][, v45][, v46][, v47][, v48][, v49][, v50][, v51][, v52][, v53][, v54][, v55][, v56][, v57][, v58][, v59][, v60], [BACKGROUND=byte array], [XAXISL=structure], [YAXISL=structure], [XAXISU=structure], [YAXISU=structure], [PLOT=structure], [CFILE=string], [LEGEND=structure], [/SPANISH], [PREEXTERNAL=string array], [EXTERNAL=string array], [/QUIET], [IN=structure], [OUT=variable], [VAR=structure], [ENTRANCE=integer], [EXIT=integer], [COLOR=byte array], [LINESTYLE=byte array], [PSYM=byte array], [NOFILL=boolean array], [THICK=float array], [SYMSIZE=float array], [XTITLE=string], [YTITLE=string], [DAXIS=4-element integer array], [TICKF=float], [EXTRAX=boolean or float], [EXTRAY=boolean or float], [XLOG=boolean or integer], [YLOG=boolean or integer], [/XLESSTICKS], [/YLESSTICKS], [/XMORETICKS], [/YMORETICKS], [MINMAX=4-elements float array], [EXTXTICKS=string array], [EXTYTICKS=string array], [XSIZE=float], [YSIZE=float], [XC=float], [YC=float], [AXISF=float], [PSASPECT=float], [PSXSIZE=float], [/LANDSCAPE], [TITLE=string], [CTABLE=byte], [CTEXT=byte], [LTYPE=integer], [/LCLEAR], [LXLEFT=float], [LYDOWN=float], [LXSIZE=float], [LYSIZE=float]

SINGLEPLOT generates a Postscript 1-D plot with as many as 16 data sets. See the full procedure

Examples
  A simple call to SINGLEPLOT is:
   x1 = FINDGEN(101)
   y1 = x1 + x1^2 - 0.01*x1^3 + 10*RANDOMN(seed,101)
   SINGLEPLOT, "test01.ps", {x:x1, y:y1}
  See the jmaplot tutorial for additional examples. 
Version
v. 3.1, 11 May 2013.
History

  v0.0: First version.
  v0.1: XLESSTICKS and YLESSTICKS introduced.
        EXTRAX and EXTRAY can be given specific values.
        XC and YC added as input variables.
        More flexibility added to XSIZE, YSIZE, and PSASPECT.
        New plot positioning algorithm.
        Multiple data sets added.
  v0.2: Error plots introduced.
        SYMSIZE added.
        legends added.
        MINMAX2 as a separate procedure.
        The preparation and opening of the PostScript file are moved to
         PREPPS and OPENPS.
  v0.3: PLOTTYPE is added to increase the funtionality and the data sets are
         changed to be introduced as v1, v2, v3... rather than as
         x1, y1, y2...
        A bug in the calculation of PSASPECT is corrected.
        DAXIS is introduced.
        PSXSIZE is introduced to allow its call from MULTIGRAPH.
        LTYPE is added.
        Arbitrary symbols for error plots are introduced.
        The procedure is reorganized for compatibility with SINGLECONTOUR
         and MULTIGRAPH.
  v0.4: EXTERNAL is introduced.
        LANDSCAPE is introduced.
        Negative values for PSYM allowed.
        Adjusted procedure for LEGEND v0.1.
        XLOG and YLOG = 2 allowed.
  v0.5: XMORETICKS and YMORETICKS introduced.
        NOFILL introduced.
        EXTXTICKS and EXTYICKS introduced.
        EXTRASEPXAXIS introduced.
        A bug with THICK is fixed.
  v1.0: General clean up.
  v1.1: LCLEAR added (LEGEND v1.1).
        BACKGROUND added.
        PLOTTYPE=7 added.
        System variables saved.
        Additinal options for DAXIS.
        PREEXTERNAL added.
  v1.2: PSFONTS added.
        CFILE='colorjma.tbl' and CTABLE=40 are made default values.
  v1.3: Maximum number of plots increased from 10 to 16.
        Some legend keyword are passed to _REF_EXTRA
  v1.3: PLOTTYPE=9 added.
  v2.0: English version.
  v2.1: IDLdoc documentation.
        CTABLE problems from MULTIGRAPH eliminated.
        Addition of new PSYM values and displacement of lines and limits to
         upper values.
        Fixed problems with filled histograms.
        Fix to the small font problem when using MULTIGRAPH (NPX).
        Fixed problems with XLOG or YLOG = 2.
  v2.2: OPENHTML introduced.
        Upgrade to IDLdoc documentation.
  v2.3: To ensure compatibility, _REF_EXTRA changed to _EXTRA.
        Eliminated the NOOPAXIS obsolete keyword.
        Windows compatibility enhanced.
        CLOSEPS bug fixed.
  v2.4: COMMON singleplotvars added.
  v2.5: Version system update.
        Maximum number of plots increased to 60.
        QUIET flag added.             
  v3.0: Possibility of using structures as data input (arrays
         become obsolete). This allows for greater flexibility
         in differentiating data.
        Axis, plot, and color file information restructured with 
         XL, YL, XU, YU, PLOT, and CFILE structures. This allows
         for more diverse axes, such as different lower and 
         upper ones.
        New horizontal+vertical error bars with angle.
        New arrow plots.
        New grid, thick, and linestyle options for axes.
        Improvement of the interaction with other IDL (external)
         routines such as MAP_SET.
        Introduction of IN and OUT structures.
        Use of most old keywords marked as obsolete.
        New variable jmaplot_path
        colorjma.tbl in jmaplot main directory and other 
         improvements to color tables.
        MAXPOINTS eliminated.                            
        PLOTTYPE eliminated.                            
        PSFONTS eliminated (now the default value).                            
        EXTRASEPXAXIS deactivated.                       
        COMMON singleplotvars eliminated.
        Histogram with border (psym=12 added).     
        CMYK PS output added.
        HTML pages moved to local directory.
        MYDEVICE eliminated.
 v3.1:  NEGATIVE added.
        NOBORDER added to LEGEND.  
Author
Jesús Maíz Apellániz, IAA
Common blocks
vv
Statistics
Lines of code  1117
McCabe Cyclomatic Complexity metric   270
McCabe Essential Complexity metric   8
McCabe Module Design Complexity metric   1

Parameters
psname
in, required
string
Postscript file name. If '' is passed, the Postscript file is neither opened nor closed (this option is intended to be used from MULTIGRAPH).
v1
in, optional
structure
First data structure. It is required if the BACKGROUND keyword is not used. Possible tags:
           X:         x values.
           Y:         y values (required).
           SX:        x uncertainty values.
           SY:        y uncertainty values.
           SXM:       x inferior uncertainty values.
           SXP:       x superior uncertainty values.
           SYM:       y inferior uncertainty values.
           SYP:       y superior uncertainty values.
           ANG:       CCW angle in degrees between y uncertainties 
                       and vertical axis.
           TXT:       Text to be written with XYOUTS.
           TXM:       XYOUTS modifiers. 
           DX:        Delta x for arrows.
           DY:        Delta y for arrows.
           HEADL:     Arrowhead length.    
           ARROWT:    Arrow thickness.
           HEADT:     Arrowhead thickness.
           COLOR:     Color index.
           LINESTYLE: IDL line style.
           PSYM:      IDL symbol code.The following non-standard values are 
                       accepted: 
       11: Filled histogram, no border
       12: Filled histogram, black (text) border
      100: circle         101: upright triangle  102: inverted triangle
      103: square         104: diamond           105: simple cross
      106; pentagon       107: hexagon           108: simple star
      109: star of David  110: complex cross     111: Sun
      112: crescent Moon  113: Earth symbol      114: heart
      120: vertical line  121: horizontal line   130: lower limit
      131: upper limit    132: right limit       133: left limit
      134-37: limits in the four quadrants
           THICK:     Line thicknesses for each data set.
           SYMSIZE:   Symbol sizes for each data set.
           NOFILL:    Flag to use with GENSYM. 
v2
in, optional
structure
Additional data structure. See v1 for tags.
v3
in, optional
structure
Additional data structure. See v1 for tags.
v4
in, optional
structure
Additional data structure. See v1 for tags.
v5
in, optional
structure
Additional data structure. See v1 for tags.
v6
in, optional
structure
Additional data structure. See v1 for tags.
v7
in, optional
structure
Additional data structure. See v1 for tags.
v8
in, optional
structure
Additional data structure. See v1 for tags.
v9
in, optional
structure
Additional data structure. See v1 for tags.
v10
in, optional
structure
Additional data structure. See v1 for tags.
v11
in, optional
structure
Additional data structure. See v1 for tags.
v12
in, optional
structure
Additional data structure. See v1 for tags.
v13
in, optional
structure
Additional data structure. See v1 for tags.
v14
in, optional
structure
Additional data structure. See v1 for tags.
v15
in, optional
structure
Additional data structure. See v1 for tags.
v16
in, optional
structure
Additional data structure. See v1 for tags.
v17
in, optional
structure
Additional data structure. See v1 for tags.
v18
in, optional
structure
Additional data structure. See v1 for tags.
v19
in, optional
structure
Additional data structure. See v1 for tags.
v20
in, optional
structure
Additional data structure. See v1 for tags.
v21
in, optional
structure
Additional data structure. See v1 for tags.
v22
in, optional
structure
Additional data structure. See v1 for tags.
v23
in, optional
structure
Additional data structure. See v1 for tags.
v24
in, optional
structure
Additional data structure. See v1 for tags.
v25
in, optional
structure
Additional data structure. See v1 for tags.
v26
in, optional
structure
Additional data structure. See v1 for tags.
v27
in, optional
structure
Additional data structure. See v1 for tags.
v28
in, optional
structure
Additional data structure. See v1 for tags.
v29
in, optional
structure
Additional data structure. See v1 for tags.
v30
in, optional
structure
Additional data structure. See v1 for tags.
v31
in, optional
structure
Additional data structure. See v1 for tags.
v32
in, optional
structure
Additional data structure. See v1 for tags.
v33
in, optional
structure
Additional data structure. See v1 for tags.
v34
in, optional
structure
Additional data structure. See v1 for tags.
v35
in, optional
structure
Additional data structure. See v1 for tags.
v36
in, optional
structure
Additional data structure. See v1 for tags.
v37
in, optional
structure
Additional data structure. See v1 for tags.
v38
in, optional
structure
Additional data structure. See v1 for tags.
v39
in, optional
structure
Additional data structure. See v1 for tags.
v40
in, optional
structure
Additional data structure. See v1 for tags.
v41
in, optional
structure
Additional data structure. See v1 for tags.
v42
in, optional
structure
Additional data structure. See v1 for tags.
v43
in, optional
structure
Additional data structure. See v1 for tags.
v44
in, optional
structure
Additional data structure. See v1 for tags.
v45
in, optional
structure
Additional data structure. See v1 for tags.
v46
in, optional
structure
Additional data structure. See v1 for tags.
v47
in, optional
structure
Additional data structure. See v1 for tags.
v48
in, optional
structure
Additional data structure. See v1 for tags.
v49
in, optional
structure
Additional data structure. See v1 for tags.
v50
in, optional
structure
Additional data structure. See v1 for tags.
v51
in, optional
structure
Additional data structure. See v1 for tags.
v52
in, optional
structure
Additional data structure. See v1 for tags.
v53
in, optional
structure
Additional data structure. See v1 for tags.
v54
in, optional
structure
Additional data structure. See v1 for tags.
v55
in, optional
structure
Additional data structure. See v1 for tags.
v56
in, optional
structure
Additional data structure. See v1 for tags.
v57
in, optional
structure
Additional data structure. See v1 for tags.
v58
in, optional
structure
Additional data structure. See v1 for tags.
v59
in, optional
structure
Additional data structure. See v1 for tags.
v60
in, optional
structure
Additional data structure. See v1 for tags.

Keywords
BACKGROUND
in, optional
byte array
Background image of dimensions (nx,ny) or (nx,ny,3).
XAXISL
in, optional
structure
Lower x-axis structure with the following possible tags:
           RANGE:     2-element float array with minimum and maximum.
           EXTRA:     If -1.0, it increases the x range by 10%. If not 1.0, it
                       increases the natural x range by that fraction. RANGE
                       supersedes it.
           LOG:       Flag for logarithmic axis. A value of 2 does not force 
                       scientific notation as 1 does.
           STYLE:     Axis type, -2 (nothing), -1 (lines), 0 (lines and
                       ticks), and 1 (lines, ticks, and text). 
           TITLE:     Axis title.                       
           THICK:     Line thickness.                   
           LINESTYLE: Line style.                       
           TICKNAME:  Text for the tick marks.            
           CHARSIZE:  Text size (also affected by PLOT.CHARSIZE).
           TICKV:     Values for the tick marks.            
           TICKLEN:   Scale factor for the tick lengths.
           LESSTICKS: Flag for using less tick marks (ignored if TICKV given).
           MORETICKS: Flag for using more tick marks (ignored if TICKV given). 
MINORN: Number of minor tick marks per major ones, counting major ones as minor (ignored if LOG is activated).
YAXISL
in, optional
structure
Lower y-axis structure. See XAXISL for the possible tags:
XAXISU
in, optional
structure
Upper x-axis structure. See XAXISL for the possible tags:
YAXISU
in, optional
structure
Upper y-axis structure. See XAXISL for the possible tags:
PLOT
in, optional
structure
Plot structure with the following possible tags:
           XSIZE:     X size (in normal coordinates) of the plot.
           YSIZE:     Y size (in normal coordinates) of the plot.
           XC:        X position (in normal coordinates) of the center of the plot.
           YC:        Y position (in normal coordinates) of the center of the plot.
           CHARSIZE:  Global text size.
           CHARTHICK: Global text thickness.
           PSASPECT:  Aspect ratio of the Postscript file.
           PSXSIZE:   X size (in cm) of the Postscript file.
           LANDSCAPE: Flag for landscape mode.
           FONT:      -1 (Vector-drawn), 0 (PS), 1 (TrueType).
           CMYK:      Flag to generate CMYK PS output.
           NEGATIVE:  Flag to generate a negative output (black and white exchanged).
           TITLE:     Main title.  
CFILE
in, optional
string
Color table structure with the following possible tags:
           NAME:      File name.                                  
           DIR:       Directory name.                             
           TABLE:     Color table.                                
           DEF:       Default color. 
LEGEND
in, optional
structure
Legend structure with the following possible tags:
           TEXT:      Legend text.
           CLEAR:     Flag to clear the legend background.
           XLEFT:     Left border of the legend box in plot-normalized
                       coordinates (default: 0.05).
           YDOWN:     Lower border of the legend box in plot-normalized
                       coordinates (default: 0.05).
           XSIZE:     Horizontal size of the legend box in plot-normalized
                       coordinates (default: 0.25).
           YSIZE:     Horizontal size of the legend box in plot-normalized
                       coordinates (default: 0.15).
           NOBORDER:  Flag not to draw a border around the legend.
SPANISH
in, optional
boolean (def. FALSE)
Flag to use decimal commas instead of decimal points.
PREEXTERNAL
in, optional
string array
String(s) with commands to be executed before the plots are drawn.
EXTERNAL
in, optional
string array
String(s) with commands to be executed after the plots are drawn.
QUIET
in, optional
boolean (def. FALSE)
Flag to supress informational messages.
IN
in, optional
structure
Input structure to pass the structures produced by out.
OUT
out, optional
variable
Output structure.
VAR
in, optional
structure
Input structure to pass additional variables.
ENTRANCE
in, optional
integer
Entrance point for sequential calls from MULTIGRAPH.
EXIT
in, optional
integer
Exit point for sequential calls from MULTIGRAPH.
COLOR
in, optional
byte array (def. [0...0])
OBSOLETE. Color for each data set. See v1.
LINESTYLE
in, optional
byte array (def. [0...0])
OBSOLETE. Line style for each data set. See v1.
a number of elements equal to the number of data sets.
PSYM
in, optional
byte array (def. [0...0])
OBSOLETE. Symbol code for each data set. See v1.
NOFILL
in, optional
boolean array (def. [FALSE...FALSE])
OBSOLETE. Flag to use with GENSYM. See v1.
THICK
in, optional
float array (def. [1...1])
OBSOLETE. Line thicknesses for each data set. See v1.
SYMSIZE
in, optional
float array (def. [1...1])
OBSOLETE. Symbol sizes for each data set. See v1.
XTITLE
in, optional
string
OBSOLETE. X title. See AXISL.
YTITLE
in, optional
string
OBSOLETE. Y title. See AXISL.
DAXIS
in, optional
4-element integer array (def. [1,1,1,1])
OBSOLETE. [yleft, xdown, yright, xup] array with options for the four axes. Allowed values are: -2 (nothing), -1 (lines), 0 (lines and ticks), and 1 (lines, ticks, and text). See AXISL.
TICKF
in, optional
float
OBSOLETE. Scale factor for the tick lengths. See AXISL.
EXTRAX
in, optional
boolean or float (def. FALSE)
OBSOLETE. As boolean (/EXTRAX), it increases the x range by 10%. As a float, it increases the x range by that fraction. See AXISL.
EXTRAY
in, optional
boolean or float (def. FALSE)
OBSOLETE. As boolean (/EXTRAY), it increases the y range by 10%. As a float, it increases the y range by that fraction. See AXISL.
XLOG
in, optional
boolean or integer (def. FALSE)
OBSOLETE. Flag for logarithmic x axis. A value of 2 does not force scientific notation as 1 does. See AXISL.
YLOG
in, optional
boolean or integer (def. FALSE)
OBSOLETE. Flag for logarithmic y axis. A value of 2 does not force scientific notation as 1 does. See XAXISL.
XLESSTICKS
in, optional
boolean (def. FALSE)
OBSOLETE. Flag to use less ticks for the x axis. See XAXISL.
YLESSTICKS
in, optional
boolean (def. FALSE)
OBSOLETE. Flag to use less ticks for the y axis. See XAXISL.
XMORETICKS
in, optional
boolean (def. FALSE)
OBSOLETE. Flag to use less ticks for the x axis (do not use for log axes). See XAXISL.
YMORETICKS
in, optional
boolean (def. FALSE)
OBSOLETE. Flag to use less ticks for the y axis (do not use for log axes). See XAXISL.
MINMAX
in, optional
4-elements float array
OBSOLETE. [xmin,ymin,xmax,ymax] values for the x and y ranges. See XAXISL.
EXTXTICKS
in, optional
string array
OBSOLETE. Text for the x axis ticks. See XAXISL.
EXTYTICKS
in, optional
string array
OBSOLETE. Text for the y axis ticks. See XAXISL.
XSIZE
in, optional
float (def. 0.75-0.82)
OBSOLETE. X size (in normal coordinates) of the plot. See PLOT.
YSIZE
in, optional
float (def. 0.75-0.82)
OBSOLETE. Y size (in normal coordinates) of the plot. See PLOT.
XC
in, optional
float (def. approx. 0.5)
OBSOLETE. X position (in normal coordinates) of the center of the plot. See PLOT.
YC
in, optional
float (def. approx. 0.5)
OBSOLETE. Y position (in normal coordinates) of the center of the plot. See PLOT.
AXISF
in, optional
float
OBSOLETE. Scale factor for the axis fonts. See PLOT.
PSASPECT
in, optional
float (def. 1.0)
OBSOLETE. Aspect ratio of the Postscript file. See PLOT.
PSXSIZE
in, optional
float (def. 19.0)
OBSOLETE. X size (in cm) of the Postscript file. See PLOT.
LANDSCAPE
in, optional
boolean (def. FALSE)
OBSOLETE. Flag for landscape mode. See PLOT.
TITLE
in, optional
string
OBSOLETE. Main title. See PLOT.
CTABLE
in, optional
byte (def. 40 or 0)
OBSOLETE. Color table. If CFILE is 'colorjma.tbl', the default value is 40. For other files the default value is 0. See CFILE.
CTEXT
in, optional
byte (def. 0 or 254)
OBSOLETE. Text and axes color. Note that the plot color is set with COLOR. The default value is 254 only if CFILE='colorjma.tbl' and CTABLE=39. See CFILE.
LTYPE
in, optional
integer (def. 1)
OBSOLETE. Legend type: 1 (standard) or 2 (only text). See LEGEND.
LCLEAR
in, optional
boolean (def. FALSE)
OBSOLETE. Flag to clear the legend background. See LEGEND.
LXLEFT
in, optional
float
OBSOLETE. Left border of the legend box in plot-normalized coordinates (default: 0.05). See LEGEND.
LYDOWN
in, optional
float
OBSOLETE. Lower border of the legend box in plot-normalized coordinates (default: 0.05). See LEGEND.
LXSIZE
in, optional
float
OBSOLETE. Horizontal size of the legend box in plot-normalized coordinates (default: 0.25). See LEGEND.
LYSIZE
in, optional
float
OBSOLETE. Vertical size of the legend box in plot-normalized coordinates (default: 0.15). See LEGEND.


Personal IDL library of Jesús Maíz Apellániz, Ramón y Cajal Fellow, Instituto de Astrofísica de Andalucía.
Feel free to contact me for more information about these routines or to submit a bug report or a feature request.

Produced by IDLdoc 1.6 beta on Fri Jun 28 22:22:46 2013