;+ ; NAME: pplot ; PURPOSE: ; produce a pretty plot for postscript. ; NOTES: ; This is a semi-intelligent wrapper for PLOT, intended to handle displaying ; dark images (where you want white axis tick marks) with axis labels ; (either white text on a black screen, or black text on white paper). ; ; ; By default, this assumes the image is mostly black, so : ; Screen: everything's white ; Postscript: black titles and labels outside the image, white ticks inside ; ; If you set 'negative' then it assumes the image is mostly white: ; ; Screen: white titles and labels outside the image, black ticks inside. ; Postscript: everything's black ; ; ; CAUTIONS: ; This code assumes that ; !p.background = WHITE (or the actual paper color) ; !p.color = BLACK (or something which shows up on your actual paper ; color) ; ; If you have mucked around with color tables such that the above is not ; true, this probably won't do what you want... ; ; ; INPUTS: ; KEYWORDS: ; OUTPUTS: ; ; HISTORY: ; Began 2003-10-24 14:09:39 by Marshall Perrin ; 2005-10-06 20:01:22 added /negative ;- pro pplot,x,y,xtickname=xtickname,ytickname=ytickname,color=color,_extra=_extra,$ xtitle=xtitle,ytitle=ytitle,title=title,negative=negative if keyword_set(color) then begin ; if the user explicitly specifies a color, then just use that! labelcolor=color tickcolor=color endif else begin ; figure out reasonable colors for paper or screen output. labelcolor = !p.color ; always use the plot color for text. if !d.name eq "PS" then begin tickcolor=!p.background ; use white ticks on black images if keyword_set(negative) then tickcolor=!p.color ; use black ticks on white images endif else begin tickcolor = !p.color ; always use white ticks for on-screen if keyword_set(negative) then tickcolor=!p.background ; use black ticks on white images endelse endelse noticks= replicate(' ', 60) if keyword_set(y) then begin plot, x,y,_extra=_extra,xtickname=xtickname,ytickname=ytickname,color=labelcolor,$ xtitle=xtitle,ytitle=ytitle,title=title plot,x,y,_extra=_extra,xtickname=noticks,ytickname=noticks,color=tickcolor,/noerase endif else begin plot,x,_extra=_extra,xtickname=xtickname,ytickname=ytickname,color=labelcolor,$ xtitle=xtitle,ytitle=ytitle,title=title plot,x,_extra=_extra,xtickname=noticks,ytickname=noticks,color=tickcolor,/noerase endelse end