| Re: Why does IDL get this wrong? [message #37538] |
Mon, 05 January 2004 07:52 |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Bruce Bowler wrote:
>
> On Fri, 02 Jan 2004 15:27:00 -0500, Ken Knapp put fingers to keyboard and
> said:
>
>> Bruce Bowler wrote:
>>
>>>
>>> Which works (even if entirely less than IOTTMCO {intuitivly obvious to
>>> most casual observer}), but gets inordinately complex if the plot in
>>> question is part of a multiplot.
>>
>> Sorry to but into the middle of this debate, but can't you use the
>> YMARGINS keyword to adjust the position? That shouldn't complicate your
>> multiplot.
>> From your example, I tried:
>> !p.multi=[0,3,3]
>> for i=0,8 do begin
>> plot, x, y, yrange = [-90, 90], /ystyle, /xstyle, $
>> ytickformat = "(a1)",title = title, $
>> xtitle = label, xrange = [0, 100], $
>> ticklen = -0.03,ymarg=[6,3]
>> endfor
>>
>>
>> ... and had no problem with the plots ... although the font was small.
>
> Thanks Ken,
>
> That does, indeed, do the trick. Now if only IDL was "smart" enough to do
> that, by default :-)
I dunno..I don't think I'd like a multi plot where each plot could have different
automatic ymargins based on my axis title. Wouldn't look very nice (IMO). Same goes for
multiple line plot titles.
paulv
--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
|
|
|
|
| Re: Why does IDL get this wrong? [message #37543 is a reply to message #37538] |
Fri, 02 January 2004 12:36  |
Bruce Bowler
Messages: 128 Registered: September 1998
|
Senior Member |
|
|
On Fri, 02 Jan 2004 15:27:00 -0500, Ken Knapp put fingers to keyboard and
said:
> Bruce Bowler wrote:
>
>>
>> Which works (even if entirely less than IOTTMCO {intuitivly obvious to
>> most casual observer}), but gets inordinately complex if the plot in
>> question is part of a multiplot.
>
> Sorry to but into the middle of this debate, but can't you use the
> YMARGINS keyword to adjust the position? That shouldn't complicate your
> multiplot.
> From your example, I tried:
> !p.multi=[0,3,3]
> for i=0,8 do begin
> plot, x, y, yrange = [-90, 90], /ystyle, /xstyle, $
> ytickformat = "(a1)",title = title, $
> xtitle = label, xrange = [0, 100], $
> ticklen = -0.03,ymarg=[6,3]
> endfor
>
>
> ... and had no problem with the plots ... although the font was small.
Thanks Ken,
That does, indeed, do the trick. Now if only IDL was "smart" enough to do
that, by default :-)
Bruce
--
+-------------------+--------------------------------------- ------------+
Bruce Bowler | Neurosis is a substitute for legitimate suffering.
1.207.633.9600 | - Anonymous
bbowler@bigelow.org |
+-------------------+--------------------------------------- ------------+
|
|
|
|
| Re: Why does IDL get this wrong? [message #37544 is a reply to message #37543] |
Fri, 02 January 2004 12:27  |
Ken Knapp
Messages: 14 Registered: April 2003
|
Junior Member |
|
|
Bruce Bowler wrote:
>
> Which works (even if entirely less than IOTTMCO {intuitivly obvious to
> most casual observer}), but gets inordinately complex if the plot in
> question is part of a multiplot.
Sorry to but into the middle of this debate, but can't you use the
YMARGINS keyword to adjust the position? That shouldn't complicate your
multiplot.
From your example, I tried:
!p.multi=[0,3,3]
for i=0,8 do begin
plot, x, y, yrange = [-90, 90], /ystyle, /xstyle, $
ytickformat = "(a1)",title = title, $
xtitle = label, xrange = [0, 100], $
ticklen = -0.03,ymarg=[6,3]
endfor
... and had no problem with the plots ... although the font was small.
Happy New Year-
-Ken
|
|
|
|
| Re: Why does IDL get this wrong? [message #37545 is a reply to message #37544] |
Fri, 02 January 2004 11:51  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Bruce Bowler writes:
> I guess at this point, it's probably best if we just "agree to disagree",
> because it's clear to me (from knowing me very well, and knowing you from
> your posts in the past) that neither one of us is going to change the
> others mind...
What!? And I thought I had a reputation as a paradigm of
reasonableness. :-)
Ok, we can agree to disagree.
Cheers,
David
P.S. If it helps any, I did find it interesting to be on
this side of the argument. I didn't expect it. :-)
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|
| Re: Why does IDL get this wrong? [message #37546 is a reply to message #37545] |
Fri, 02 January 2004 11:29  |
Bruce Bowler
Messages: 128 Registered: September 1998
|
Senior Member |
|
|
On Fri, 02 Jan 2004 12:26:40 -0700, David Fanning put fingers to keyboard
and said:
> Bruce Bowler writes:
>
>> Don't get me wrong, I don't like MS as much as the next guy and I've
>> always been a proponent of giving the user as much control as possible,
>> but I'd at least like a reasonable starting point.
>
> I would have thought a one-line title was a reasonable
> starting point, but maybe that's just me. :-)
I guess at this point, it's probably best if we just "agree to disagree",
because it's clear to me (from knowing me very well, and knowing you from
your posts in the past) that neither one of us is going to change the
others mind...
--
+-------------------+--------------------------------------- ------------+
Bruce Bowler | Hollywood shoots too many pictures and not enough
1.207.633.9600 | actors. - Walter Winchell
bbowler@bigelow.org |
+-------------------+--------------------------------------- ------------+
|
|
|
|
| Re: Why does IDL get this wrong? [message #37547 is a reply to message #37546] |
Fri, 02 January 2004 11:26  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Bruce Bowler writes:
> Don't get me wrong, I don't like MS as much as the next guy and I've
> always been a proponent of giving the user as much control as possible,
> but I'd at least like a reasonable starting point.
I would have thought a one-line title was a reasonable
starting point, but maybe that's just me. :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|
| Re: Why does IDL get this wrong? [message #37548 is a reply to message #37547] |
Fri, 02 January 2004 11:13  |
Bruce Bowler
Messages: 128 Registered: September 1998
|
Senior Member |
|
|
On Fri, 02 Jan 2004 12:11:56 -0700, David Fanning put fingers to keyboard
and said:
> P.S. Let's just say I don't mind programs that still give
> me a bit of control over things. Makes me feel useful. :-)
Don't get me wrong, I don't like MS as much as the next guy and I've
always been a proponent of giving the user as much control as possible,
but I'd at least like a reasonable starting point.
--
+-------------------+--------------------------------------- ------------+
Bruce Bowler | Nothing is so strong as gentleness, nothing as
1.207.633.9600 | gentle as real strength. - St. Francis de Sales
bbowler@bigelow.org |
+-------------------+--------------------------------------- ------------+
|
|
|
|
| Re: Why does IDL get this wrong? [message #37549 is a reply to message #37548] |
Fri, 02 January 2004 11:11  |
Michael Wallace
Messages: 409 Registered: December 2003
|
Senior Member |
|
|
Bruce Bowler wrote:
> Kindly watch for linewraps...
>
> x=[0,0,0,0,44.8,75.7,64.1,70.4,73.9,74.2,68.1,48.9,44.0,35.7 ,27.6,12.3,7.3,0]
> y=[-85,-75,-65,-55,-45,-35,-25,-15,-5,5,15,25,35,45,55,65,75 ,85]
> title='title'
> label='line1!Cline2'
> plot, x, y, yrange = [-90, 90], /ystyle, /xstyle, ytickformat = "(a1)",
> title = title, xtitle = label, xrange = [0, 100], ticklen = -0.03
>
> If ticklen is +0.03, all is fine, but setting it negative (to get the
> ticks outside the box) and the second line of the xtitle is lost.
IDL positions the axis titles relative to the axis labels. The axis
labels are positioned relative to the tick marks. When you draw the
tick marks outside the box, this causes the labels to be placed lower
than they would be if the ticks were drawn inside the box. This in turn
causes the title to be placed lower. And the second line of your title
is simply getting clipped off at the bottom of the image.
One thing you can try is playing around with the position keyword to the
plot command (or !p.position if you want the same positioning on all
plots). Essentially, you can set position such that there's more room
around the boundary of your plot. With more room, the second line of
your title will show up.
> related question (in that involves plots), is there a way to draw the box
> around the plot (the boss likes that) but *not* draw the tickmarks on the
> non-primary lines of the box?
You have to use two plot commands to achieve this effect.
Plot, FIndGen(10), TICKLEN = 0
Plot, FIndGen(10), XSTYLE = 8, YSTYLE = 8, /NOERASE, /NODATA
The first command will draw a plot without any tick marks whatsoever.
The second command will draw only the primary axes ([XY]STYLE = 8) --
this time with tick marks. The NOERASE flag makes the second plot draw
on top of the previous one instead of erasing it first. And viola!
Your primary axes have ticks and the others don't.
Mike
|
|
|
|
| Re: Why does IDL get this wrong? [message #37550 is a reply to message #37549] |
Fri, 02 January 2004 11:11  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Bruce Bowler writes:
> Which works (even if entirely less than IOTTMCO {intuitivly obvious to the
> most casual observer}), but gets inordinately complex if the plot in
> question is part of a multiplot.
>
> I maintain (and always will, just because that's the way I am :-) that
> what IDL does now is "wrong". It, and it alone, knows how it is going to
> render what I ask it to render. It must be able to position the data so
> that all of what I ask it to render is rendered...
Well, I don't know. Microsoft tries to build programs that do
all the thinking for you and, well... don't get me started in
that direction. :-(
Cheers,
David
P.S. Let's just say I don't mind programs that still give
me a bit of control over things. Makes me feel useful. :-)
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|
| Re: Why does IDL get this wrong? [message #37551 is a reply to message #37549] |
Fri, 02 January 2004 11:00  |
Bruce Bowler
Messages: 128 Registered: September 1998
|
Senior Member |
|
|
On Fri, 02 Jan 2004 11:29:09 -0700, David Fanning put fingers to keyboard
and said:
> Bruce Bowler writes:
>
>> x=[0,0,0,0,44.8,75.7,64.1,70.4,73.9,74.2,68.1,48.9,44.0,35.7 ,27.6,12.3,7.3,0]
>> y=[-85,-75,-65,-55,-45,-35,-25,-15,-5,5,15,25,35,45,55,65,75 ,85]
>> title='title'
>> label='line1!Cline2'
>> plot, x, y, yrange = [-90, 90], /ystyle, /xstyle, ytickformat = "(a1)",
>> title = title, xtitle = label, xrange = [0, 100], ticklen = -0.03
>>
>> If ticklen is +0.03, all is fine, but setting it negative (to get the
>> ticks outside the box) and the second line of the xtitle is lost.
>
> Just give yourself some more room for the plot. Add a POSITION keyword:
>
>> plot, x, y, yrange = [-90, 90], /ystyle, /xstyle, ytickformat = "(a1)",
>> $
>> title = title, xtitle = label, xrange = [0, 100], ticklen = -0.03, $
> POSITION=[0.1, 0.15, 0.9, 0.9]
>
>
Which works (even if entirely less than IOTTMCO {intuitivly obvious to the
most casual observer}), but gets inordinately complex if the plot in
question is part of a multiplot.
I maintain (and always will, just because that's the way I am :-) that
what IDL does now is "wrong". It, and it alone, knows how it is going to
render what I ask it to render. It must be able to position the data so
that all of what I ask it to render is rendered...
>> related question (in that involves plots), is there a way to
>> draw the
>> box around the plot (the boss likes that) but *not* draw the tickmarks
>> on the non-primary lines of the box?
>
> Plot, findgen(11), XStyle=8, YStyle=8 ; or 9 if you want exact ranges
> Plots, [!X.CRange[1], !X.Crange[1]], [!Y.CRange[0], !Y.CRange[1]]
> Plots, [!X.CRange[0], !X.Crange[1]], [!Y.CRange[1], !Y.CRange[1]]
Works like a champ...
--
+-------------------+--------------------------------------- ------------+
Bruce Bowler | Sex is the worst reason to marry or divorce. - Dr.
1.207.633.9600 | Albert Ellis
bbowler@bigelow.org |
+-------------------+--------------------------------------- ------------+
|
|
|
|
| Re: Why does IDL get this wrong? [message #37552 is a reply to message #37551] |
Fri, 02 January 2004 10:29  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Bruce Bowler writes:
> x=[0,0,0,0,44.8,75.7,64.1,70.4,73.9,74.2,68.1,48.9,44.0,35.7 ,27.6,12.3,7.3,0]
> y=[-85,-75,-65,-55,-45,-35,-25,-15,-5,5,15,25,35,45,55,65,75 ,85]
> title='title'
> label='line1!Cline2'
> plot, x, y, yrange = [-90, 90], /ystyle, /xstyle, ytickformat = "(a1)",
> title = title, xtitle = label, xrange = [0, 100], ticklen = -0.03
>
> If ticklen is +0.03, all is fine, but setting it negative (to get the
> ticks outside the box) and the second line of the xtitle is lost.
Just give yourself some more room for the plot. Add a POSITION
keyword:
> plot, x, y, yrange = [-90, 90], /ystyle, /xstyle, ytickformat = "(a1)", $
> title = title, xtitle = label, xrange = [0, 100], ticklen = -0.03, $
POSITION=[0.1, 0.15, 0.9, 0.9]
> related question (in that involves plots), is there a way to draw the box
> around the plot (the boss likes that) but *not* draw the tickmarks on the
> non-primary lines of the box?
Plot, findgen(11), XStyle=8, YStyle=8 ; or 9 if you want exact ranges
Plots, [!X.CRange[1], !X.Crange[1]], [!Y.CRange[0], !Y.CRange[1]]
Plots, [!X.CRange[0], !X.Crange[1]], [!Y.CRange[1], !Y.CRange[1]]
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|