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

Home » Public Forums » archive » Re: (simple question) PLOT, YTICKS in /YLOG AXIS
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: (simple question) PLOT, YTICKS in /YLOG AXIS [message #59489] Fri, 28 March 2008 14:06
David Fanning is currently offline  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 Go to previous message
David Fanning is currently offline  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 Go to previous message
David Fanning is currently offline  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 Go to previous message
Paul Van Delst[1] is currently offline  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 Go to previous message
David Fanning is currently offline  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 Go to previous message
natha is currently offline  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 Go to previous message
David Fanning is currently offline  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 Go to previous message
natha is currently offline  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.")
Re: (simple question) PLOT, YTICKS in /YLOG AXIS [message #59500 is a reply to message #59498] Fri, 28 March 2008 11:22 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
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.")
Re: (simple question) PLOT, YTICKS in /YLOG AXIS [message #59501 is a reply to message #59500] Fri, 28 March 2008 10:55 Go to previous message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
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?

Thanks,

Bernat
Re: (simple question) PLOT, YTICKS in /YLOG AXIS [message #59502 is a reply to message #59501] Fri, 28 March 2008 10:46 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jo Klein writes:

> You've run into the infamous minor-tick-labelling problem. As is so
> often the case, David's website has the solution:
> <http://www.dfanning.com/graphics_tips/minorlog.html>

Humm. I couldn't even understand that article. :-(

I've made a couple of small changes that I think makes
it easier to understand.

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 #59503 is a reply to message #59502] Fri, 28 March 2008 10:18 Go to previous message
Jo Klein is currently offline  Jo Klein
Messages: 54
Registered: January 2006
Member
You've run into the infamous minor-tick-labelling problem. As is so
often the case, David's website has the solution:
<http://www.dfanning.com/graphics_tips/minorlog.html>
Cheers,
Jo
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: triangulating over undefined space in irregular grids
Next Topic: Re: emacs, fedora 8, idlwave and IDL7

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

Current Time: Thu Oct 09 04:55:07 PDT 2025

Total time taken to generate the page: 8.24210 seconds