comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » 24-bit color postscript again
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
24-bit color postscript again [message #13115] Fri, 09 October 1998 00:00 Go to previous message
bowman is currently offline  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 @
[Message index]
 
Read Message
Read Message
Previous Topic: Problem with writing HDF
Next Topic: IDL compound widgets

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:14:25 PDT 2025

Total time taken to generate the page: 0.00357 seconds