[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Baffled by color postscript



OK, I've been through many of David's great web pages, and through the portion
of his book related to the subject. Still, I get only monochrome output, or
none at all. Here is what I am doing. Note that this works perfectly for the X
display (that part between the X-only comments). Running on SGI Octane, IDL
5.0 MIPS

; x,y are 1xn vectors of data
; my_rgb is a 3xn byte values of RGBs for each respective
;    element of x,y

; save current device, open postscript
thisdevice = !d.name
set_plot, 'PS', /copy
device, xsize=6, ysize=6, /inches, bits_per_pixel=24, /color

; plot the axes
plot, x, y, /nodata, xrange=[0,20], yrange=[0,20], title=chartTitle
saveColor = !p.color

;;;; X-only code starts
; loop through the data rgb_index() returns the 24 bit color
for i = 0, l-1 do begin
	!p.color = rgb_index(my_rgb[0,i],my_rgb[1,i],my_rgb[2,i])
	plots, x[i], y[i], psym=4
end

; plot a line at unity, make it the default color
!p.color = saveColor
oplot, [0,20],[0,20]

;;;; X-only code ends

; close it up and reset the device
device, /close_file
set_plot, thisdevice


Any ideas what is wrong? This code produces a postscript file with only the
axes and the line at [0,20],[0,20]. From experimenting with SYMSIZE, I believe
the points are actually plotting, but they are always white. (When I set
SYMSUZE=20, portions of the axes are overwritten, presumably by the large data points.)