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

Home » Public Forums » archive » Labeling logarithmic axes
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
Labeling logarithmic axes [message #92734] Thu, 18 February 2016 17:16 Go to next message
laura.hike is currently offline  laura.hike
Messages: 87
Registered: September 2013
Member
Hi,

I can't find anything recent about this problem, so....

I am making a line plot and would like to use a logarithmic y-axis. So far so good. I use

pavgsw = plot(merraaswhr,merrap,color='red',thick=2,name='MERRA2',yra nge = [1000,100],ylog=1)

I get a nice plot with a log axis BUT only the 1000 and 100 tick marks are labeled. I would like to label 500 and 200 as well. Doug Fanning has a nice discussion of this at http://www.idlcoyote.com/graphics_tips/minorlog.html, however, the information seems to be outdated (or at least the keywords aren't recognized under the new graphics system). I tried a variety of options based on his method, like defining

axislabels = ['1000', '','','','','500','','','200','100']

then adding

pavgsw.ytickname = axislabels with or without pavgsw.ymajor = 9

(or doing the same with key words in the original plot statement).

The problem is that as soon as I add the ytickname option, the tick marks go back to linear spacing. Does anyone know how to fix this? I should point out that the plotted lines are not affected by the changes to the axis, only the axis markings are.

Thanks much,

Laura H.
Re: Labeling logarithmic axes [message #92786 is a reply to message #92734] Sat, 27 February 2016 11:50 Go to previous messageGo to next message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
On Thursday, February 18, 2016 at 7:16:10 PM UTC-6, Laura H. wrote:
> The problem is that as soon as I add the ytickname option, the tick marks go back to linear spacing. Does anyone know how to fix this? I should point out that the plotted lines are not affected by the changes to the axis, only the axis markings are.
>
> Thanks much,
>
> Laura H.

Hi Laura-

You're going to want to suppress the minor ticks for this:

p=plot(/test, /ylog, yrange=[1000, 100])
ticks = [1000, 500, 200, 100]
p.ytickvalues = ticks
p.yminor=0

For kicks and giggles:
ticks2 = REVERSE((FINDGEN(10)+1)*100)
p.ytickvalues = ticks2
Re: Labeling logarithmic axes [message #92805 is a reply to message #92786] Wed, 02 March 2016 12:18 Go to previous messageGo to next message
laura.hike is currently offline  laura.hike
Messages: 87
Registered: September 2013
Member
Thanks!


On Saturday, February 27, 2016 at 2:50:53 PM UTC-5, Phillip Bitzer wrote:
> On Thursday, February 18, 2016 at 7:16:10 PM UTC-6, Laura H. wrote:
>> The problem is that as soon as I add the ytickname option, the tick marks go back to linear spacing. Does anyone know how to fix this? I should point out that the plotted lines are not affected by the changes to the axis, only the axis markings are.
>>
>> Thanks much,
>>
>> Laura H.
>
> Hi Laura-
>
> You're going to want to suppress the minor ticks for this:
>
> p=plot(/test, /ylog, yrange=[1000, 100])
> ticks = [1000, 500, 200, 100]
> p.ytickvalues = ticks
> p.yminor=0
>
> For kicks and giggles:
> ticks2 = REVERSE((FINDGEN(10)+1)*100)
> p.ytickvalues = ticks2
Re: Labeling logarithmic axes [message #92806 is a reply to message #92786] Wed, 02 March 2016 12:25 Go to previous message
laura.hike is currently offline  laura.hike
Messages: 87
Registered: September 2013
Member
Phil,

I still can't get this to work. When I add your commands after making the plot, it reverses the orientation of the y-axis (i.e., was 1000 to 100, reverses to 100 to 1000). If I force the orientation with a new yrange command, it flips, but the locations of the tick marks are incorrect: 100 is closer to 200 than 900 is to 1000. I don't understand this.

Laura




On Saturday, February 27, 2016 at 2:50:53 PM UTC-5, Phillip Bitzer wrote:
> On Thursday, February 18, 2016 at 7:16:10 PM UTC-6, Laura H. wrote:
>> The problem is that as soon as I add the ytickname option, the tick marks go back to linear spacing. Does anyone know how to fix this? I should point out that the plotted lines are not affected by the changes to the axis, only the axis markings are.
>>
>> Thanks much,
>>
>> Laura H.
>
> Hi Laura-
>
> You're going to want to suppress the minor ticks for this:
>
> p=plot(/test, /ylog, yrange=[1000, 100])
> ticks = [1000, 500, 200, 100]
> p.ytickvalues = ticks
> p.yminor=0
>
> For kicks and giggles:
> ticks2 = REVERSE((FINDGEN(10)+1)*100)
> p.ytickvalues = ticks2
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Segmentation fault (core dumped)
Next Topic: Harris website down?

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

Current Time: Wed Oct 08 11:37:45 PDT 2025

Total time taken to generate the page: 0.00593 seconds