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

Home » Public Forums » archive » Re: cgcolorbar problem in postscript
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: cgcolorbar problem in postscript [message #81947 is a reply to message #81945] Wed, 07 November 2012 08:22 Go to previous messageGo to previous message
Phillip M. Bitzer is currently offline  Phillip M. Bitzer
Messages: 7
Registered: September 2012
Junior Member
Like David said, this is not a problem with the file or cgColorbar, but
I don't think this is a "problem" exactly with Preview either - it seems
to be an issue with aliasing. Consider the program below, which is
similar to yours (note I don't load in a color bar, rather I specify the
RGB palette). After producing the eps file, open it in Preview. You'll
probably see the graduated colors, which I think is what you are reporting.

If you go to Preferences->PDF, and toggle the Check box for "Smooth text
and line art", then you will see your discrete color bar reappear. The
text won't look as nice, however. This is an issue with the default
aliasing used by Preview - smoothing introduces the graduated colors you
see.

For reference, here's what I see:
https://www.dropbox.com/s/rvax832ot0t8l2b/colorbar_nosmooth. png

https://www.dropbox.com/s/2b2k8jj1taifpk0/colorbar_smooth.pn g

PRO pmbtest, Do_Ps = do_ps

colors = [ 'hot pink', 'indian red', 'dark green', 'green', $
'sky blue', 'cadet blue', 'grey', 'blue', 'purple', 'red']

n_color = N_ELEMENTS(colors)

do_ps = KEYWORD_SET(do_ps)
IF do_ps THEN BEGIN
PS_START, filename='test.eps', /ENCAP, /NOMATCH, $
XSIZE=6, YSIZE=2, /INCHES
ENDIF ELSE cgERASE, 'white'

rgb = cgCOLOR(colors, /TRIPLE)

;display the colorbar
cgCOLORBAR, /DISCRETE, NCOLORS=n_color, PALETTE = rgb, POSITION=[0.1,
0.2, 0.9, 0.9]

IF do_ps THEN PS_END

END
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: NDVI
Next Topic: Re: Finding pixel values of GeoTIFF image based on lat/lon (ENVI and IDL give different results).

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

Current Time: Wed Oct 08 18:33:03 PDT 2025

Total time taken to generate the page: 0.00247 seconds