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

Home » Public Forums » archive » Problems with colorbar matching contour colors
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Problems with colorbar matching contour colors [message #85466] Sun, 11 August 2013 15:23 Go to previous message
morganlsilverman is currently offline  morganlsilverman
Messages: 46
Registered: February 2013
Member
I've created a new colortable. When I load the colortable to only use 26 colors to match the 25 contour levels I've plotted, the colorbar displays the colors squished at the bottom and then a gray scale colorbar for the remaining space. I'm not sure why this is happening. I only want my color bar to go from 0-25 even though my max value is well above 100. I want the values higher than 25 to be the same color as the 25th. An abbreviated code is below. I'd appreciate any help with why the colorbar isn't filling with the abbreviated number of colors or a better way to do this. Thank you.

nlevels=26

loadct, 41, ncolors=26
cgDisplay, 600, 500
contourlevels = cgConLevels(EpBin, nlevels=25, MaxValue=25)
cgplot, lonrange, latrange, /noerase, xstyle=1,ystyle=1,/nodata,xrange=xrange,$
yrange=yrange, position=pp, yticks = 8, xticks=6, xminor=1, charsize=1, $
xtitle = 'Longitude', ytitle = 'Latitude'
cgcontour, EpBin, longrid, latgrid, levels=contourlevels, /fill, $
c_colors=indgen(nlevels)+1, /overplot, position=[0.125,0.125,0.8,0.85]
cgcolorbar;, range=[0,25], divisions=5, position=[0.125, 0.92, 0.9, 0.96],/vertical,/right
[Message index]
 
Read Message
Read Message
Previous Topic: 3d plot
Next Topic: Persistent environment variables (in DLM example)

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

Current Time: Wed Oct 08 18:29:37 PDT 2025

Total time taken to generate the page: 0.00242 seconds