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

Home » Public Forums » archive » Re: Error in coyote's colorbar
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
Re: Error in coyote's colorbar [message #56284] Fri, 12 October 2007 11:20
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
> Not David but, do you mean yrange? Try:
>
> colorbar, yrange=[0.001,70.7107]

hmm, now here is some oddness...

colorbar, range=[0.,70.7107], /ylog, /vertical,
ytickv=LogLevels([0.,70.7107]) , yticks=0
works just fine (just have to play with the format keyword)

and

colorbar, range=[0.,70.7107], /ylog, /vertical,
ytickv=LogLevels([0.,70.7107])
errors...

So the difference is just the yticks=0 keyword.

What does that mean? Now I am confused.

Cheers,

Brian

------------------------------------------------------------ --------------
Brian Larsen
Boston University
Center for Space Physics
Re: Error in coyote's colorbar [message #56288 is a reply to message #56284] Fri, 12 October 2007 08:38 Go to previous message
Loren Anderson is currently offline  Loren Anderson
Messages: 22
Registered: August 2007
Junior Member
Another way to approach this problem may be to scale the colors and
not the image, especially since you are working with a small dynamic
range.

TVLCT, r, g, b, /Get
rnew = logscl(r) ;These are David Fanning routines as well
bnew = logscl(g)
gnew = logscl(b)
TVLCT, rnew, gnew, bnew
colorbar, minrange = 0, maxrange = 70.7107, format = '(f6.2)', /
vertical, /right

The colors in the colorbar are logarithmic, but the values are linear,
if that makes any sense. I don't like scaling the images because it
can take a long time for the images I work with. I think it's easier
to read too.

-Loren
Re: Error in coyote's colorbar [message #56298 is a reply to message #56288] Thu, 11 October 2007 11:08 Go to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
> this is ploting an array with -inf in it, which is ignored by plot.
> It then is plotting the next value (for instance -1) so it is fine.
> You are explicilty telling the plot command to plot from -inf to 70,
> which it cannot do.

ok, that makes sense.


> how about setting range = [min(loglevels[0,70.7107]),
> max(loglevels[0,70.7107])] ?

oddly, this has the same error:
IDL> colorbar, range=[min(loglevels([0,70.7107])),
max(loglevels([0,70.7107]))], /ylog, /vertical,
ytickv=LogLevels([0,70.7107])
% AXIS: Data coordinate system not established.
% Error occurred at: COLORBAR 412 /Users/balarsen/Documents/
idl/larsen/fanning/colorbar.pro
% $MAIN$
% Execution halted at: $MAIN$


this however, does work:
colorbar, range=[0,70.7107], /ylog, /vertical, /minor, $
ticknames=LogLevels([0,70.7107]), $
divisions=n_elements(LogLevels([0,70.7107]))

except there is n+1 ticks so there is one extra label (and in the
wrong place)

this is the equilivant that you can run without loglevels():
colorbar, range=[0,70.7107], /ylog, /vertical, /minor,$
ticknames=[.1,1,10], divisions=3


Cheers,

Brian

------------------------------------------------------------ --------------
Brian Larsen
Boston University
Center for Space Physics
Re: Error in coyote's colorbar [message #56299 is a reply to message #56298] Thu, 11 October 2007 10:56 Go to previous message
R.G.Stockwell is currently offline  R.G.Stockwell
Messages: 163
Registered: October 2004
Senior Member
"Brian Larsen" <balarsen@gmail.com> wrote in message
news:1192124714.944888.178400@v3g2000hsg.googlegroups.com...
>> change the lower limit in range to something other than 0.
>> You are trying to plot from -inf to 70.
>> That should do it.
>
> I agree, but the issue is that in general (or kinda general) you don't
> really know how far above zero to go, like sometimes .1 is far enough
> and others .001 is what it takes for the plot. I was hoping to let
> loglevels and idl figure out the right answer,
>
> colorbar, yrange=[0.1,70.7107], /ylog, /vertical,$
> ytickv=LogLevels([0.1,70.7107])
>
> does work but it doesn't look right.
>
> How does idl properly handle?
> plot, alog10(findgen(100)/10.)

this is ploting an array with -inf in it, which is ignored by plot.
It then is plotting the next value (for instance -1) so it is fine.
You are explicilty telling the plot command to plot from -inf to 70,
which it cannot do.

how about setting range = [min(loglevels[0,70.7107]),
max(loglevels[0,70.7107])] ?

Cheers,
bob
Re: Error in coyote's colorbar [message #56300 is a reply to message #56299] Thu, 11 October 2007 10:49 Go to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
> What is the output of
>
> LogLevels([0.,70.7107])
this is from http://www.dfanning.com/tip_examples/loglevels.pro

IDL> print, LogLevels([0.,70.7107])
0.10000000 1.0000000 10.000000

this seems consistent to me as it is inside the range.



Brian

------------------------------------------------------------ --------------
Brian Larsen
Boston University
Center for Space Physics
Re: Error in coyote's colorbar [message #56301 is a reply to message #56300] Thu, 11 October 2007 10:45 Go to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
> change the lower limit in range to something other than 0.
> You are trying to plot from -inf to 70.
> That should do it.

I agree, but the issue is that in general (or kinda general) you don't
really know how far above zero to go, like sometimes .1 is far enough
and others .001 is what it takes for the plot. I was hoping to let
loglevels and idl figure out the right answer,

colorbar, yrange=[0.1,70.7107], /ylog, /vertical,$
ytickv=LogLevels([0.1,70.7107])

does work but it doesn't look right.

How does idl properly handle?
plot, alog10(findgen(100)/10.)
since that is also -inf to ~1



Brian

------------------------------------------------------------ --------------
Brian Larsen
Boston University
Center for Space Physics
Re: Error in coyote's colorbar [message #56302 is a reply to message #56301] Thu, 11 October 2007 10:37 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Brian Larsen wrote:
>> Not David but, do you mean yrange? Try:
>>
>
> Bob, thanks I think I do mean range not zrange but it doesn't change
> the error.
>
> IDL> colorbar, range=[0.,70.7107], /ylog, /vertical, $
> ytickv=LogLevels([0.,70.7107])
> % PLOT: Warning: Infinite plot range.
> % AXIS: Data coordinate system not established.
> % Error occurred at: COLORBAR 412 /Users/balarsen/Documents/
> idl/larsen/fanning/colorbar.pro
> % $MAIN$
> % Execution halted at: $MAIN$

What is the output of

LogLevels([0.,70.7107])

?

Is it acceptable for ytickv input? Is it consistent with

range=[0.,70.7107]

?
Re: Error in coyote's colorbar [message #56303 is a reply to message #56302] Thu, 11 October 2007 10:32 Go to previous message
R.G.Stockwell is currently offline  R.G.Stockwell
Messages: 163
Registered: October 2004
Senior Member
"Brian Larsen" <balarsen@gmail.com> wrote in message
news:1192122015.534351.251220@r29g2000hsg.googlegroups.com.. .
>
>> Not David but, do you mean yrange? Try:
>>
>
> Bob, thanks I think I do mean range not zrange but it doesn't change
> the error.
>
> IDL> colorbar, range=[0.,70.7107], /ylog, /vertical, $


change the lower limit in range to something other than 0.
You are trying to plot from -inf to 70.
That should do it.

Cheers,
bob
Re: Error in coyote's colorbar [message #56304 is a reply to message #56303] Thu, 11 October 2007 10:00 Go to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
> Not David but, do you mean yrange? Try:
>

Bob, thanks I think I do mean range not zrange but it doesn't change
the error.

IDL> colorbar, range=[0.,70.7107], /ylog, /vertical, $
ytickv=LogLevels([0.,70.7107])
% PLOT: Warning: Infinite plot range.
% AXIS: Data coordinate system not established.
% Error occurred at: COLORBAR 412 /Users/balarsen/Documents/
idl/larsen/fanning/colorbar.pro
% $MAIN$
% Execution halted at: $MAIN$





Cheers,

Brian

------------------------------------------------------------ --------------
Brian Larsen
Boston University
Center for Space Physics
Re: Error in coyote's colorbar [message #56305 is a reply to message #56304] Thu, 11 October 2007 09:53 Go to previous message
R.G.Stockwell is currently offline  R.G.Stockwell
Messages: 163
Registered: October 2004
Senior Member
"Brian Larsen" <balarsen@gmail.com> wrote in message
news:1192119579.974652.297380@o80g2000hse.googlegroups.com.. .
> David et al,
...
> IDL> colorbar, zrange=[0.,70.7107], /ylog, /vertical,


Not David but, do you mean yrange? Try:

colorbar, yrange=[0.001,70.7107]

Cheers,
bob
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: structure into strcuture
Next Topic: map_set and limit question

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

Current Time: Wed Oct 08 20:04:35 PDT 2025

Total time taken to generate the page: 0.00656 seconds