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

Home » Public Forums » archive » Colorbar problems
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Colorbar problems [message #24693] Tue, 17 April 2001 12:57 Go to next message
francesco.spada is currently offline  francesco.spada
Messages: 8
Registered: April 2001
Junior Member
Please could you help me with this colorbar problems?

When I plot the topography I use this lines:

cctop=intarr(20)
cctop(0)=10
cctop(1)=100
FOR i=1,19 DO BEGIN
cctop(i) = cctop(i-1) + 4
endfor
;
contour,z, POSITION=[0.15, 0.15, 0.95, 0.75],$
xstyle=9,xtitle='x-axis (km)',ystyle=9,ytitle='y-axis (km)',$

levels=[-.1,.0,25,50,100,200,300,400,500,600,700,800,900,100 0,1250,1500,$
1750,2000,2500,3000], $
ticklen=-0.02, c_colors=cctop,charsize=1.5,/fill

but I don't know if is possible to set up David colobar in a correct
way
(or if you have a better idea for plotting topography).
The biggest problem is that I plot levels with irregular distance,
the only idea I have is putting the same "irregularity" in cctop!!
but I think is more than bad programming :-((

I have a similar problem here

level_var=FLTARR(14)
color_var=FLTARR(N_ELEMENTS(level_topo))
step_col=14
FOR i=0,N_ELEMENTS(level_var)-1 DO BEGIN

level_var(i)=MIN(var2d)+i*(MAX(var2d)*1.1-MIN(var2d))/N_ELEM ENTS(level_var)
ENDFOR
;
CONTOUR,var2d,XSTYLE=1,YSTYLE=1,xf,yf,LEVELS=level_var, $
POSITION=xposition, CHARSIZE=chr_sz, $
TITLE=title,XTITLE=xtitle,YTITLE=ytitle,/nodata
CONTOUR,var2d,XSTYLE=1,YSTYLE=1,xf,yf,LEVELS=level_var, $
C_COLORS=color_var, ; could be that without this line it's all right
...
/OVERPLOT,/FILL
CONTOUR,var2d,XSTYLE=1,YSTYLE=1,xf,yf,LEVELS=level_var, $
/OVERPLOT, COLOR=3,THICK=tck
Re: Colorbar problems [message #24847 is a reply to message #24693] Wed, 25 April 2001 18:02 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Francesco (francesco.spada@jrc.it) writes:

> When I plot the topography I use this lines:
>
> cctop=intarr(20)
> cctop(0)=10
> cctop(1)=100
> FOR i=1,19 DO BEGIN
> cctop(i) = cctop(i-1) + 4
> endfor
> ;
> contour,z, POSITION=[0.15, 0.15, 0.95, 0.75],$
> xstyle=9,xtitle='x-axis (km)',ystyle=9,ytitle='y-axis (km)',$
>
> levels=[-.1,.0,25,50,100,200,300,400,500,600,700,800,900,100 0,1250,1500,$
> 1750,2000,2500,3000], $
> ticklen=-0.02, c_colors=cctop,charsize=1.5,/fill
>
> but I don't know if is possible to set up David colobar in a correct
> way
> (or if you have a better idea for plotting topography).
> The biggest problem is that I plot levels with irregular distance,
> the only idea I have is putting the same "irregularity" in cctop!!
> but I think is more than bad programming :-((

I realize this reply is belated, but I don't see a reply
in my newsreader.

My COLORBAR routine has absolutely no problem with
irregular contour levels. Just use [XY]TICKV, etc.
But I do think it odd that you would use noncontiguous
color values. I've never done this. Add although I admit
to being terribly jet-lagged, I can't for the life of me
come up with a scenario where I would. If you wanted likely
colors in indices 10 to 100, wouldn't you do something like
this:

LOADCT, 33, NColors=90, Bottom=10
Colorbar, XTickV=levels, NColors=90, Bottom=10

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: 2 variables on same plot?
Next Topic: AAARGH!!! IDL5.2 crashes with CALL_EXTERNAL

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

Current Time: Wed Oct 08 13:51:51 PDT 2025

Total time taken to generate the page: 0.00553 seconds