PRO cafe_plot_empty, env, group, position=position, $ distinct=distinct, $ ; template values color=color, $ ; for data plot linestyle=linestyle, $ psym=psym, $ deltacolor=deltacolor, $ deltalinestyle=deltalinestyle, $ deltapsym=deltapsym, $ range=range,quiet=quiet, $ _EXTRA=ex, $ help=help,shorthelp=shorthelp ;+ ; NAME: ; plot_empty ; ; PURPOSE: ; do not plot anything ; ; CATEGORY: ; cafe ; ; SUBCATEGORY: ; plot type ; ; INPUTS: ; ; group - (optional) Define the data group to plot. ; Default is the primary group 0. Must be in ; range [0..9]. ; distinct - (optional) Plot frame in different color if ; some plot types are add in a single panel. ; ; deltacolor - Color difference for distinct data sets. ; ; deltalinestyle - Increase of line styles for distinct data ; sets. Default: 0 (no change). ; ; deltapsym - Increase of point symbols for distinct data ; sets. May be positive or negative ; integer number. Default: 0 (no change). ; ; If psym exceeds -7..7 it will be set at 0 (no ; symbol). Therefore it is recomended to ; plot data sets with lines with a negative ; deltapsym (to decrease and restart from 0). ; ; PLOT OUTPUT: ; ; empty - Do not plot. Useful for frame creation as placeholder. ; Range is taken from valid data set. ; ; SIDE EFFECTS: ; None. ; ; EXAMPLE: ; > plot, empty, model ; -> nothing above, but model below. ; ; HISTORY: ; $Id: cafe_plot_empty.pro,v 1.10 2004/07/30 17:17:26 goehler Exp $ ;- ; ; $Log: cafe_plot_empty.pro,v $ ; Revision 1.10 2004/07/30 17:17:26 goehler ; fix: allow negative deltacolor also without exceeding 0..255 range ; ; Revision 1.9 2003/12/01 07:53:00 goehler ; change: data sets contain "title" to store information in. ; files remain unmodified when applying modify,file=foo command. ; ; Revision 1.8 2003/11/10 12:44:36 goehler ; fix: apply psym change only when deltapsym is actually set ; ; Revision 1.7 2003/11/06 10:25:11 goehler ; update: allow psym/linestyle to vary for distinct data groups. ; documentation is updated. ; ; Revision 1.6 2003/11/04 14:27:37 goehler ; added help with shorthelp for all subtopics ; added qdp x binsize info (for plot also) ; ; Revision 1.5 2003/03/03 11:18:23 goehler ; major change: environment struct has become a pointer -> support of wplot/command line ; in common. ; Branch to be able to maintain the former line also. ; ; Revision 1.4 2002/09/10 13:24:32 goehler ; updated name convention: ; - the command name for all commands ; - the command name + "_" + subcommand name for all subcommands ; ; Revision 1.3 2002/09/09 17:36:08 goehler ; public version: updated help matching aitlib html structure. ; common version: 3.0 ; ; ; ;; command name of this source (needed for automatic help) name="plot_empty" ;; ------------------------------------------------------------ ;; HELP ;; ------------------------------------------------------------ ;; if help given -> print the specification above (from this file) IF keyword_set(help) THEN BEGIN cafe_help,env, name return ENDIF ;; ------------------------------------------------------------ ;; SHORT HELP ;; ------------------------------------------------------------ IF keyword_set(shorthelp) THEN BEGIN cafereport,env, "empty - plot empty frame" return ENDIF ;; ------------------------------------------------------------ ;; SETUP ;; ------------------------------------------------------------ ;; define color delta IF n_elements(deltacolor) EQ 0 THEN deltacolor = 23 ;; define linestyle delta IF n_elements(deltalinestyle) EQ 0 THEN deltalinestyle = 0 ;; define psym delta IF n_elements(deltapsym) EQ 0 THEN deltapsym = 0 ;; ------------------------------------------------------------ ;; DEFINE RANGE ;; ------------------------------------------------------------ IF n_elements(range) NE 0 THEN BEGIN ;; check range for all subgroups: FOR i = 0, n_elements((*env).groups[group].data)-1 DO BEGIN ;; skip empty groups: IF NOT PTR_VALID((*env).groups[group].data[i].x) THEN CONTINUE ;; use only defined datapoints properly: def_index = where(*(*env).groups[group].data[i].def) ;; skip datasets without valid points: IF def_index[0] EQ -1 THEN CONTINUE x = (*(*env).groups[group].data[i].x)[def_index] y = (*(*env).groups[group].data[i].y)[def_index] err = (*(*env).groups[group].data[i].err)[def_index] range[0] = range[0] < min(x) range[1] = range[1] > max(x) range[2] = range[2] < min(y) range[3] = range[3] > max(y) ENDFOR ENDIF ;; ------------------------------------------------------------ ;; PLOT NO DATA ;; ------------------------------------------------------------ ;; plot all subgroups: FOR i = 0, n_elements((*env).groups[group].data)-1 DO BEGIN ;; skip empty subgroups: IF NOT PTR_VALID((*env).groups[group].data[i].x) THEN CONTINUE ;; plot only defined datapoints properly: def_index = where(*(*env).groups[group].data[i].def) undef_index = where(*(*env).groups[group].data[i].def EQ 0) select_index = where(*(*env).groups[group].data[i].selected $ AND *(*env).groups[group].data[i].def) ;; points defined: IF def_index[0] EQ -1 THEN CONTINUE ;; extract data sets: x = (*(*env).groups[group].data[i].x)[def_index] y = (*(*env).groups[group].data[i].y)[def_index] IF PTR_VALID((*env).groups[group].data[i].err) THEN $ err = (*(*env).groups[group].data[i].err)[def_index] ;; define bin width IF ptr_valid((*env).groups[group].data[i].dx) THEN $ dx = (*(*env).groups[group].data[i].dx)[def_index]$ ELSE $ dx = 0.5*[x[1]-x[0],(x-shift(x,1))[1:*]] ; default bin width: midth between two x values ;; here we plot nothing! ;; add no legend information: ;; cafelegendinfo, env, (*env).groups[group].data[i].title, "data", group, $ ;; color=color, linestyle=linestyle,psym=psym,_EXTRA=ex ;; change style when each data set is plotted different: IF keyword_set(distinct) THEN BEGIN ;; change color if some given: color = color - deltacolor ;; wrap around if too much colors: IF color LT 0 THEN color = color + 255 IF color GT 255 THEN color = color MOD 256 ;; change linestyle if different: linestyle = linestyle + deltalinestyle ;; wrap around linestyles: IF linestyle LT 0 THEN linestyle = 5 IF linestyle GT 5 THEN linestyle = 0 ;; change psym if different: psym = psym + deltapsym ;; wrap around psym, respect psym sign, allow psym > 7 if ;; not changing: IF deltapsym NE 0 AND abs(psym) GT 7 THEN psym = 0 ENDIF ENDFOR END