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

Home » Public Forums » archive » Re: What is going on with the minor ticks on log plots?????
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: What is going on with the minor ticks on log plots????? [message #12579] Wed, 26 August 1998 00:00
Joe[2] is currently offline  Joe[2]
Messages: 11
Registered: May 1998
Junior Member
Well, here is the solution. Run the following code.

Pro TEST
; No, this is not a protest ;)

!p.multi = [0,3,2]
!p.ticklen = .07

; This does not work
!x.style = 1
plot,/xlog,[1],[10],xrange=[1.e10,1.e13],xticks=3
plot,/xlog,[1.e9],[10],xrange=[1.e7,1.e10],xticks=3
plot,/xlog,[1.e-3],[10],xrange=[1.e-5,1.e-1],xticks=4

; This works
!x.style = 0
plot,/xlog,[1],[10],xrange=[1.e10,1.e13],xticks=3
plot,/xlog,[1.e9],[10],xrange=[1.e7,1.e10],xticks=3
plot,/xlog,[1.e-3],[10],xrange=[1.e-5,1.e-1],xticks=4

end


It appears that the anomalous behavior is related solely
to the value of !x.style. Not knowing how the IDL source
code is written I can onnly guess as to the cause of the
problem. Either a different chunk of code is called when
xstyle is 1 rather than 0 that handles powers of ten beyond
0 to 10 differently or powers of ten outside the range
from 0 to 10 are not sufficiently "exact" so as to be
recognized as an integer power of ten when xstyle=1.

I bet on the former.
Re: What is going on with the minor ticks on log plots????? [message #12581 is a reply to message #12579] Wed, 26 August 1998 00:00 Go to previous message
Joe[2] is currently offline  Joe[2]
Messages: 11
Registered: May 1998
Junior Member
OK,

Here is a bit of code that does fail (work?) to demonstrate the
problem.

Pro TEST

!p.multi = [0,7,10] & !y.minor = 2
!x.margin = [.5,.5] & !y.margin = [.5,.5]
!y.omargin = [3,3] & !p.ticklen = 0.07
!p.charsize = .7
nulls = replicate("",20) & blanks = replicate(" ",20)

!y.range=[0,60]
!x.title = "" & !x.style = 12 & !y.style = 12
!x.range = [1.e10,1.e13] & !x.ticks = 1 & !x.minor=0
plot,/xtype,[1],/nodata
xyouts,4e10,44,'date = '+strtrim(991212L,2)+' SR',size=.4
xyouts,4e10,38,'hhmmss = '+string(3335,form='(i6.6)'),size=.4
xyouts,4e10,32,'lat = '+string(56.,form='(f6.1)'),size=.4
xyouts,4e10,26,'lon = '+string(92.,form='(f6.1)'),size=.4
xyouts,4e10,20,'beta = '+string(15.,form='(f6.1)'),size=.4
!y.style=1 & !x.style=1
!y.tickname = nulls & !x.tickname = blanks

; Ozone plot
if(!p.multi(0) eq 6) then begin
!x.title = 'O!d3!n (cm!u-3!n)'
!x.tickname = nulls
endif
plot,/xlog,[1],[10],xrange=[1.e10,1.e13],xticks=3
plot,/xlog,[1.e9],[10],xrange=[1.e7,1.e10],xticks=3,yticknam e=blanks
plot,/xlog,[1.e-3],[10],xrange=[1.e-5,1.e-1],xticks=4,ytickn ame=blanks
end
Re: What is going on with the minor ticks on log plots????? [message #12583 is a reply to message #12579] Wed, 26 August 1998 00:00 Go to previous message
Joe[2] is currently offline  Joe[2]
Messages: 11
Registered: May 1998
Junior Member
> Joe (Post.Reply@This.News.Group) writes:
>
>> I'm running v5.1 under NT and have noticed the following bad
>> behavior. While using the /XLOG key along with even powers of
>> 10 for XRANGE and XTICKS set to the proper number of decades
>> and xminor set to zero. I either do or do not get the expected
>> minor ticks at (2,3,4,5,6,7,8,9). After some experimentation, it
>> became apparent that the range specified by XRANGE had to
>> fall wholly within the range from 1.000 to 1.e10.
>>
>> That is
>> plot,[1],/nodata,/xlog,xrange=[1,1000],xticks=3,xminor=0
>> works, but
>> plot,[1],/nodata,/xlog,xrange=[0.1,100],xticks=3,xminor=0
>> plot,[1],/nodata,/xlog,xrange=[1.e8,1.e11],xticks=3,xminor=0
>> do not!
>>
>
> I am running Windows NT 4, SP3 on my machine and I find that
> all three of these commands work correctly in both IDL 5.1 and
> IDL 5.1.1. Could this be a graphics driver problem?
>
> Cheers,
>
> David


Dave,

Thanks for noticing this. Hmmm, Works here now too! Each
of these commands work if I type them in a new IDL session, but
fail after I run a particular program. This is obviously a bit more
subtle of a problem. I'll try and reproduce the problem and submit
the code for review.


New topic: Why does IDL v 5.1 nolonger CD to the source directory
of a .pro file when I double click on it from the explorer, but does if
I use the IDL:file:open menu to open it? If this is an intentional shift
in operating standards - I do not like it. I lose track of my postscript
file output now (ends up in the the IDL Source tree root directory).

More in a bit,

JMZ
Re: What is going on with the minor ticks on log plots????? [message #12585 is a reply to message #12579] Wed, 26 August 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Joe (Post.Reply@This.News.Group) writes:

> I'm running v5.1 under NT and have noticed the following bad
> behavior. While using the /XLOG key along with even powers of
> 10 for XRANGE and XTICKS set to the proper number of decades
> and xminor set to zero. I either do or do not get the expected
> minor ticks at (2,3,4,5,6,7,8,9). After some experimentation, it
> became apparent that the range specified by XRANGE had to
> fall wholly within the range from 1.000 to 1.e10.
>
> That is
> plot,[1],/nodata,/xlog,xrange=[1,1000],xticks=3,xminor=0
> works, but
> plot,[1],/nodata,/xlog,xrange=[0.1,100],xticks=3,xminor=0
> plot,[1],/nodata,/xlog,xrange=[1.e8,1.e11],xticks=3,xminor=0
> do not!
>
> This strikes me as being arbitrary behavior and, therfore,
> a BUG in IDL. This may actually be a very old bug going back
> several versions of IDL. Does this happen on other platforms?
> It also appears on IDL for Digital Unix as far as I know.
>
> Is there a way around this to force the proper minor ticks no
> matter the bounds of XRANGE. I have not tested this on YRANGE
> but assume there is similar behavior.

I am running Windows NT 4, SP3 on my machine and I find that
all three of these commands work correctly in both IDL 5.1 and
IDL 5.1.1. Could this be a graphics driver problem?

Cheers,

David

----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438, Toll-Free Book Orders: 1-888-461-0155
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Image Object ROI selection
Next Topic: Re: Object method name problem

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

Current Time: Fri Oct 10 03:09:42 PDT 2025

Total time taken to generate the page: 1.43929 seconds