cgcolorbar problem in postscript [message #81972] |
Mon, 05 November 2012 00:59 |
Ailie
Messages: 2 Registered: November 2012
|
Junior Member |
|
|
Hi all,
I'm trying to make a discrete colorbar for an image and plotting straight to postscript. But cgcolorbar.pro is giving some unexpected behaviour.
Basically, I'm trying to plot a discrete colorbar (using the DISCRETE keyword) with 6 colors in postscript. If I plot in using the X device, it behaves as I expect, producing a colorbar with six, distinct divisions, each division filled with a solid block of color.
But when I plot in postscript, my resulting colorbar most definitely has more than 6 colors and instead appears to have graduating color. I'm not sure exactly how many colors, but it's far more than 6. In particular, at the division where my ticks and labels are, the color spans the tick.
Here's my snippet:
cgloadct,0
cgloadct,2,bottom=1,ncolors=6,/rev
nc=6
levels = indgen(7)*5
lab=string(levels,format='(i3)')
lab=strcompress(lab,/remove_all)
cgcolorbar, ticknames=lab, charsize=4, charthick=2,/discrete, $
bottom=1, ncolors=nc, annotatecolor=cgcolor('black'), font=1, $
/right, /vert, title = 'levels', pos=[0.87,0.10,0.89,0.90]
As I said, if I plot this in a window using the X device, it's fine and as I expect, but using the postscript device gives far more than 6 levels, with graduating color particularly visible around the tickmarks. You'll note that I load the second colorbar into the first 6 color indices only, but the postscript still results in graduating colors over those 6 colors.
I'm using IDL 8.1 on OS 10.6.5, but have also tried this on IDL 7.0 and IDL 8.2.1 and the same thing happens every time.
Thanks in advance,
Ailie
|
|
|