Re: (simple question) PLOT, YTICKS in /YLOG AXIS [message #59489] |
Fri, 28 March 2008 14:06 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul van Delst writes:
> Man, the minute hand sure does move slow on a friday.....
This is what happens when you tell yourself you are
*definitely* going to get some work done, and then the
phone rings, the dog wants out, the program that used
to work perfectly crashes for some unknown reason, and...
I know it's five o'clock somewhere. Guess this will wait
for tomorrow.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: (simple question) PLOT, YTICKS in /YLOG AXIS [message #59490 is a reply to message #59489] |
Fri, 28 March 2008 14:03  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul van Delst writes:
> Man, the minute hand sure does move slow on a friday.....
Boy, you've got that right... Where did Coyote go with
the beer, for God's sake!!
Let me try this again:
ticks = LOGLEVELS([0.22,0.55])
nticks = N_Elements(ticks)
Plot, data, /YLOG, YRANGE=[0.22,0.55], YTICKS=nticks-1, $
YTICKV=ticks
Sheesh!!
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: (simple question) PLOT, YTICKS in /YLOG AXIS [message #59491 is a reply to message #59490] |
Fri, 28 March 2008 13:57  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> This happens when there is a mismatch between the number
> of values returned by LOGLEVELS and the number you use
> for YTICKS. This is why I think you should look at the
> *REVISED* web page article and use the code you find there:
>
> ticks = LOGLEVELS([0.22,0.55])
> nticks = N_Elements(ticks)
> Plot, data, /YLOG, YRANGE([0.22,0.55])YTICKS=nticks-1, $
> YTICKV=Reverse(ticks)
Oh, hell, I should never have reversed those damn axes!!
This will lead to another five questions. Sigh...
ticks = LOGLEVELS([0.22,0.55])
nticks = N_Elements(ticks)
Plot, data, /YLOG, YRANGE([0.22,0.55])YTICKS=nticks-1, $
YTICKV=ticks
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: (simple question) PLOT, YTICKS in /YLOG AXIS [message #59492 is a reply to message #59491] |
Fri, 28 March 2008 13:57  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
David Fanning wrote:
> bernat writes:
>
>> Looks this example:
>>
>> Plot, [10], [0.3], yr=[0.22,0.55], xr=[0,20], ystyle=1, /ylog,
>> psym=2, yticks=1, ytickv=loglevels([0.22,0.55])
>>
>> the result is:
>>
>> % PLOT: Data coordinate system not established.
>
> This happens when there is a mismatch between the number
> of values returned by LOGLEVELS and the number you use
> for YTICKS. This is why I think you should look at the
> *REVISED* web page article and use the code you find there:
>
> ticks = LOGLEVELS([0.22,0.55])
> nticks = N_Elements(ticks)
> Plot, data, /YLOG, YRANGE([0.22,0.55])YTICKS=nticks-1, $
Shouldn't that be
YRANGE *=* [0.22,0.55] *,* YTICKS=nticks-1
?
Or does IDL workbench accept user-defined syntax?
:o)
Man, the minute hand sure does move slow on a friday.....
cheers,
paulv
> YTICKV=Reverse(ticks)
>
> Cheers,
>
> David
|
|
|
Re: (simple question) PLOT, YTICKS in /YLOG AXIS [message #59493 is a reply to message #59492] |
Fri, 28 March 2008 13:52  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
bernat writes:
> Looks this example:
>
> Plot, [10], [0.3], yr=[0.22,0.55], xr=[0,20], ystyle=1, /ylog,
> psym=2, yticks=1, ytickv=loglevels([0.22,0.55])
>
> the result is:
>
> % PLOT: Data coordinate system not established.
This happens when there is a mismatch between the number
of values returned by LOGLEVELS and the number you use
for YTICKS. This is why I think you should look at the
*REVISED* web page article and use the code you find there:
ticks = LOGLEVELS([0.22,0.55])
nticks = N_Elements(ticks)
Plot, data, /YLOG, YRANGE([0.22,0.55])YTICKS=nticks-1, $
YTICKV=Reverse(ticks)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: (simple question) PLOT, YTICKS in /YLOG AXIS [message #59495 is a reply to message #59493] |
Fri, 28 March 2008 13:06  |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
Yeah,
Looks this example:
Plot, [10], [0.3], yr=[0.22,0.55], xr=[0,20], ystyle=1, /ylog,
psym=2, yticks=1, ytickv=loglevels([0.22,0.55])
the result is:
% PLOT: Data coordinate system not established.
Cheers,
Bernat
On Mar 28, 3:28 pm, David Fanning <n...@dfanning.com> wrote:
> bernat writes:
>> The only problem that I have is in some cases.
>> For example, if I want to representate a log axis with values
>> [0.2,0.55]. Then the loglevels returns 0.5 but if I do the plot with
>> YTICKS=1 and YICKV=LOGLEVELS(yrange) the following problem occurs:
>
>> % PLOT: Data coordinate system not established.
>
>> Do you know why ? What can I do to solve this problem ?
>
> I don't seem to have that problem. This command works fine:
>
> IDL> plot, indgen(11), Scale_vector(indgen(11), 0.1, 0.55), $
> /ylog, ytickv=loglevels([0.2, 0.55]), yticks=1, ystyle=1
>
> Do you have a specific command that doesn't work?
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: (simple question) PLOT, YTICKS in /YLOG AXIS [message #59497 is a reply to message #59495] |
Fri, 28 March 2008 12:28  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
bernat writes:
> The only problem that I have is in some cases.
> For example, if I want to representate a log axis with values
> [0.2,0.55]. Then the loglevels returns 0.5 but if I do the plot with
> YTICKS=1 and YICKV=LOGLEVELS(yrange) the following problem occurs:
>
> % PLOT: Data coordinate system not established.
>
> Do you know why ? What can I do to solve this problem ?
I don't seem to have that problem. This command works fine:
IDL> plot, indgen(11), Scale_vector(indgen(11), 0.1, 0.55), $
/ylog, ytickv=loglevels([0.2, 0.55]), yticks=1, ystyle=1
Do you have a specific command that doesn't work?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: (simple question) PLOT, YTICKS in /YLOG AXIS [message #59498 is a reply to message #59497] |
Fri, 28 March 2008 12:18  |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
Hey David,
thank you for your article. I utilise the LOGLEVELS for put the yticks
and works good !
The only problem that I have is in some cases.
For example, if I want to representate a log axis with values
[0.2,0.55]. Then the loglevels returns 0.5 but if I do the plot with
YTICKS=1 and YICKV=LOGLEVELS(yrange) the following problem occurs:
% PLOT: Data coordinate system not established.
Do you know why ? What can I do to solve this problem ?
On Mar 28, 2:22 pm, David Fanning <n...@dfanning.com> wrote:
> bernat writes:
>> I use the LOGLEVELS function and I try to do my plot like the
>> example.
>> I dont know how many YTIKCS I need to chose.
>
>> I didn't succed...
>
>> Any suggestions?
>
> Read the updated article:
>
> http://www.dfanning.com/graphics_tips/minorlog.html
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
|
|
|