Re: IDL 8, log plots and titles [message #73209 is a reply to message #73114] |
Tue, 26 October 2010 14:21  |
b_gom
Messages: 105 Registered: April 2003
|
Senior Member |
|
|
Well, maybe 'correctly' was the wrong choice of words. I meant that
the direct graphics routines almost always do something reasonable if
you don't set any keywords. They don't refuse to plot logarithmic data
or hide titles, for example. I won't be carrying around
"yrange=total(y GT 0) GT 0 ? > [min(y[where(y GT 0)]),max(y)] :
[(machar()).xmin,(machar()).xmax]" in my head each time I want to do a
quick log plot..
I've been encouraging coleagues to start using IDL 8 because of the
great new graphics functions, and almost immediately I get questions
about plot behaviour that I can't explain.
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?
Thanks
On Oct 26, 2:33 pm, Paolo <pgri...@gmail.com> wrote:
> "correctly"? I think the automatic choice of yrange for a logarithmic
> plot is a matter of personal preference - but certainly for any
> serious
> work you want to set the yrange explicitely yourself. But even when I
> am
> too lazy to do so, I would prefer this behavior as default:
>
> title='pretty plot'
>
> ;pardon the kilometric one-liner
> ;wrapped to survive google groups posting
> plot,x,y,/ylog, $
> yrange=total(y GT 0) GT 0 ? $
> [min(y[where(y GT 0)]),max(y)] : $
> [(machar()).xmin,(machar()).xmax],$
> title=total(y LT 0) GT 0 ? $
> 'NEGATIVE VALUES NOT PLOTTED '+$
> title:title
>
> Ciao,
> Paolo
>
>
>
>
>
>> ;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?- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
|
|
|