IDL 8, log plots and titles [message #73119] |
Tue, 26 October 2010 12:03  |
b_gom
Messages: 105 Registered: April 2003
|
Senior Member |
|
|
Am I missing something, or is IDL 8 fumbling logarithmic y axes and
plot titles when using the new plot function?
When plotting log plots, the plot title seems to vanish, and also IDL
does not seem to be able to calculate the y range properly. In the
sample code below, compare the direct graphics output (which handles
the range and title correctly automatically) to the new plot function
output which doesn't seem to be able to figure out what I want:
----------------------------------------
x=findgen(100)/100*3*!pi
y=sin(x)
;This is what I expect; yaxis handles infinite log range and title
appears correctly
plot,x,y,/ylog,title='Direct Graphics Yrange and Title'
;Now for the plot function output:
;title works for linear y axes
p1=plot(x,y,yrange=[0.1,1],title='Linear Y Axis
Works',window_title='Linear Y Axis Works')
;title gone for log plots
p2=plot(x,y,/ylog,yrange=[0.1,1],title='Title Error Log Y
Axis',window_title='Title Error Log Y Axis')
;if you set the yrange, the title appears, but in the wrong place
p3=plot(x,(y+2)*10,/ylog,yrange=[1,100],title='Title Error Log Y
Axis',window_title='Title Error Log Y Axis')
;if you don't set the yrange, the title is gone
p4=plot(x,(y+2)*10,/ylog,title='Title Error Log Y
Axis',window_title='Title Error Log Y Axis')
----------------------------------------
Any ideas?
|
|
|
Re: IDL 8, log plots and titles [message #73190 is a reply to message #73119] |
Wed, 27 October 2010 10:29  |
b_gom
Messages: 105 Registered: April 2003
|
Senior Member |
|
|
Good to hear that its a fixed bug. Hopefully I won't trip over the 98
others before the patch is released.
Thanks also for the muli-plot tips; I agree that the LAYOUT keyword is
an improvement.
|
|
|
Re: IDL 8, log plots and titles [message #73193 is a reply to message #73119] |
Wed, 27 October 2010 09:50  |
Mark Piper
Messages: 198 Registered: December 2009
|
Senior Member |
|
|
On Oct 26, 1:03 pm, b_gom <b_...@hotmail.com> wrote:
> Am I missing something, or is IDL 8 fumbling logarithmic y axes and
> plot titles when using the new plot function?
>
> When plotting log plots, the plot title seems to vanish, and also IDL
> does not seem to be able to calculate the y range properly. In the
> sample code below, compare the direct graphics output (which handles
> the range and title correctly automatically) to the new plot function
> output which doesn't seem to be able to figure out what I want:
>
> ----------------------------------------
> x=findgen(100)/100*3*!pi
> y=sin(x)
>
> ;This is what I expect; yaxis handles infinite log range and title
> appears correctly
> plot,x,y,/ylog,title='Direct Graphics Yrange and Title'
>
> ;Now for the plot function output:
> ;title works for linear y axes
> p1=plot(x,y,yrange=[0.1,1],title='Linear Y Axis
> Works',window_title='Linear Y Axis Works')
> ;title gone for log plots
> p2=plot(x,y,/ylog,yrange=[0.1,1],title='Title Error Log Y
> Axis',window_title='Title Error Log Y Axis')
> ;if you set the yrange, the title appears, but in the wrong place
> p3=plot(x,(y+2)*10,/ylog,yrange=[1,100],title='Title Error Log Y
> Axis',window_title='Title Error Log Y Axis')
> ;if you don't set the yrange, the title is gone
> p4=plot(x,(y+2)*10,/ylog,title='Title Error Log Y
> Axis',window_title='Title Error Log Y Axis')
> ----------------------------------------
>
> Any ideas?
This bug (along with 98 others) is fixed in IDL 8.0.1, which will be
available on our website very soon.
mp
|
|
|
Re: IDL 8, log plots and titles [message #73196 is a reply to message #73119] |
Wed, 27 October 2010 07:14  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paulo Penteado writes:
> I agree layout is better, for those reasons, and most significantly,
> for not being a global variable. Everything that determines how a plot
> will be in Graphics is contained in them, and set through their
> methods. The frequent use of global variables (in particular those
> that are not affected by .reset) is one of the most important reasons
> I avoid DG.
Absolutely! Alright, then, graphics containment and layout
are two things we will keep when we go to the simpler
new, new graphics system in IDL 10. :-)
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: IDL 8, log plots and titles [message #73198 is a reply to message #73119] |
Wed, 27 October 2010 07:08  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Oct 27, 12:00 pm, David Fanning <n...@dfanning.com> wrote:
> Just to prove I'm not a complete Luddite, I
> actually think this LAYOUT keyword method is
> better than using !P.Multi. It is more
> flexible for laying out non-symmetrical plots.
> And the huge bonus is you don't have to learn
> to count backwards!
I agree layout is better, for those reasons, and most significantly,
for not being a global variable. Everything that determines how a plot
will be in Graphics is contained in them, and set through their
methods. The frequent use of global variables (in particular those
that are not affected by .reset) is one of the most important reasons
I avoid DG.
|
|
|
Re: IDL 8, log plots and titles [message #73199 is a reply to message #73119] |
Wed, 27 October 2010 07:00  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Kenneth P. Bowman writes:
> The equivalent of !P.MULTI is to use the LAYOUT and CURRENT keywords,
> but you do have to manage the current drawing pane manually, as David
> illustrated here
>
>> You want to use the LAYOUT keyword in conjunction with
>> the CURRENT keyword.
>> IDL> p = plot(loaddata(17), layout=[2,2,1])
>> IDL> p = plot(loaddata(17), layout=[2,2,2], /current)
>> IDL> p = plot(loaddata(17), layout=[2,2,3], /current)
>> IDL> p = plot(loaddata(17), layout=[2,2,4], /current)
Just to prove I'm not a complete Luddite, I
actually think this LAYOUT keyword method is
better than using !P.Multi. It is more
flexible for laying out non-symmetrical plots.
And the huge bonus is you don't have to learn
to count backwards!
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: IDL 8, log plots and titles [message #73200 is a reply to message #73119] |
Wed, 27 October 2010 06:37  |
Kenneth P. Bowman
Messages: 585 Registered: May 2000
|
Senior Member |
|
|
In article
<94acbdd6-bedf-4e89-a45c-37b3b534c5c0@f33g2000yqh.googlegroups.com>,
b_gom <b_gom@hotmail.com> wrote:
> A related question- I assume it isn't possible to produce multiple
> plots with the new graphics functions without manually defining the
> layout. i.e., there is no equivalent of setting !p.multi. Is this
> true?
The equivalent of !P.MULTI is to use the LAYOUT and CURRENT keywords,
but you do have to manage the current drawing pane manually, as David
illustrated here
> You want to use the LAYOUT keyword in conjunction with
> the CURRENT keyword.
> IDL> p = plot(loaddata(17), layout=[2,2,1])
> IDL> p = plot(loaddata(17), layout=[2,2,2], /current)
> IDL> p = plot(loaddata(17), layout=[2,2,3], /current)
> IDL> p = plot(loaddata(17), layout=[2,2,4], /current)
Ken Bowman
|
|
|
|