Colorbar with logarithm base 2 [message #71552] |
Mon, 28 June 2010 02:07 |
Mrunmayee
Messages: 24 Registered: May 2009
|
Junior Member |
|
|
I have a file with longitude(l), latitude(b) and temperature(Ts). I
want to plot - just a rectangular plot - l and b but I want to color
the symbols according to the temperature. So here is what I do:
Rdfloat,filename,l,b,Ts
tscolors = BytScl(Ts, top=!D.Table_Size-2) ; Shamelessly picked from
David's "color according to elevation" routine.
Plot, l, b,/nodata
Plots, l, b, psym=symcat(16), color=tscolors ; Filled circle
Problem 1.
Ts is ranges from 10 to 2500 (approx) with most of the Ts values
concentrated below 200. So, if I use it as above, I get only few spots
with any color.
My solution: Making it log_10 doesn't help, because the range gets too
small (~1 to ~3) and the plot looks far more uniformly colored. So, I
made it log_2 which gives me a range of about (~3,~12). So I do
following:
log2ts = Alog10(Ts)/Alog10(2.)
log2tscolors = BytScl(log2ts, top=!D.Table_Size-2)
And rest of the plotting, as above.
Problem 2.
I also want to show colorbar next to this plot, but not sure how to
show colors according to Log_2. I mean, how do colors get scales when
scheme is changed from linear to log?
Solution to either problem is appreciated, although solution to 2nd
problem is of interest for pure 'academic' reasons.
|
|
|