Device independent plotting [message #70806] |
Wed, 05 May 2010 02:56 |
Karen
Messages: 3 Registered: May 2010
|
Junior Member |
|
|
I am using IDL workbench on a Mac at work and a PC at home and I'd
like my code to plot the same colours independent of device and
platform. I've downloaded the FSC_Color app and read the very helpful
documentation by David Fanning. I thought I had followed his
instructions carefully for how to get device independent colours, but
I can't make it work. At the moment, if I plot to the screen, I get
the classic red on black colour scheme, and in Postscript it only
plots the axes and labels.
The relevant part of my code looks like this:
;Initialise device independent colour routine
backColor = FSC_Color("White", !D.Table_Size-2)
envColor = FSC_Color("Red", !D.Table_Size-3)
dataColor = FSC_Color("Charcoal", !D.Table_Size-4)
!p.multi=[0,1,1]
set_plot,'ps'
minval=min(aftercoinciardata,/nan,max=maxval) ;find min and max for
plotting
;set up plot x axis and parameters with no data
plot,x,aftercoinciardata[0,*],/
nodata,yrange=[minval*1.5,maxval*1.5],ystyle=1,xtitle="time after
coinc(s) ",ytitle="IAR change(mWm!E-2!
N)",title=file,Background=backColor
for i=0L, (n_elements(aftercoinciardata[*,0])-1) do begin
oplot,x,aftercoinciardata[i,*],thick=0.25,Color=dataColor,li nestyle=1 ;plot
each line one by one
endfor
oplot,x,envelope_max,thick=3,color=envcolor ;red
oplot,x,envelope_min,thick=3,color=envcolor
device,/close
end
|
|
|