24-bit color postscript again [message #13115] |
Fri, 09 October 1998 00:00  |
bowman
Messages: 121 Registered: September 1991
|
Senior Member |
|
|
I haven't been able to make my 24-bit color postscript plotting work yet,
so I wrote a simple example to illustrate my problem. You need a 24-bit
display to make this work and a color postscript printer or viewer.
PRO TEST24, PRINT = print
!P.BACKGROUND = 256L^3 - 1L ;Set background color to white
!P.FONT = -1L ;Use Hershey fonts
IF KEYWORD_SET(print) THEN BEGIN
SET_PLOT, 'PS'
DEVICE, /COLOR, BITS_PER_PIXEL = 8, /SCHOOLBOOK, FONT_SIZE=10, /PORTRAIT
!P.BACKGROUND = 0L ;Set background color to white
!P.FONT = 0L ;Use hardware fonts
ENDIF
n = 10000L
x = RANDOMU(seed, n)
y = RANDOMU(seed, n)
r = LONG(255*x)
g = LONG(255*y)
b = REPLICATE(0B, n)
color = r + 256L*(g + 256L*b)
PLOT, [0,0], [1,1], /NODATA, COLOR = 0
PLOTS, x, y, PSYM=1, COLOR = color
IF KEYWORD_SET(print) THEN DEVICE, /CLOSE
SET_PLOT, 'X'
!P.BACKGROUND = 0L
END
The program works when plotting to the X device (black in lower left, red
in lower right, green in upper left, yellow in upper right). When the
PostScript option is selected (/PRINT), all of the points plot as
grayscale or white. How do I get the colors to work with Postscript?
Thanks, Ken
--
Dr. Kenneth P. Bowman, Professor 409-862-4060
Department of Meteorology 409-862-4466 fax
Texas A&M University bowmanATcsrp.tamu.edu
College Station, TX 77843-3150 Replace AT with @
|
|
|