Re: One title to rule them all... [message #57567] |
Thu, 13 December 2007 07:25 |
lasse
Messages: 48 Registered: February 2007
|
Member |
|
|
On 13 Dec, 15:17, wlandsman <wlands...@gmail.com> wrote:
> On Dec 13, 6:02 am, Lasse Clausen <la...@lbnc.de> wrote:
>
>> Greetings,
>
>> suppose I have a plot consisting of four panels on top of each other.
>> Let's also suppose all are showing the same quantity, just measured by
>> different instruments. Since the y axis title is rather longish - like
>> 'Compressional Component [nT]' - I would like one ytitle for all 4
>> panels.
>
> You might look at the recent enhancements by Erin Sheldon to
> multiplot.pro (http://idlastro.gsfc.nasa.gov/ftp/pro/plot/
> multiplot.pro ) which creates multiple plots like !p.multi but with a
> lot more control over the appearance. For example, it accepts
> mTitle, mXTitle, and mYtitle keywords to specify the title , Y title
> and X title for the entire matrix of plots (along with keywords like
> mxTitSize=, mxTitOffset= to control the size and offset from the
> axis.) For example,
>
> erase & multiplot, [1,4], mXtitle='R', mYtitle='Compressional
> Component [nT]'
> for i=0,3 do begin
> plot,indgen(10)
> multiplot
> endfor
> multiplot,/reset
>
> There are other keywords to control the size of the gaps between the
> plots, or to force the individual plots to be square,
Fogive me for this, but it was too obvious and I have just hit
puberty:
mxTitSize, mxTitOffset, chichichichi
[snigger]
Cheers for the link, though, I will have a look
Lasse
|
|
|
Re: One title to rule them all... [message #57568 is a reply to message #57567] |
Thu, 13 December 2007 07:17  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On Dec 13, 6:02 am, Lasse Clausen <la...@lbnc.de> wrote:
> Greetings,
>
> suppose I have a plot consisting of four panels on top of each other.
> Let's also suppose all are showing the same quantity, just measured by
> different instruments. Since the y axis title is rather longish - like
> 'Compressional Component [nT]' - I would like one ytitle for all 4
> panels.
>
You might look at the recent enhancements by Erin Sheldon to
multiplot.pro (http://idlastro.gsfc.nasa.gov/ftp/pro/plot/
multiplot.pro ) which creates multiple plots like !p.multi but with a
lot more control over the appearance. For example, it accepts
mTitle, mXTitle, and mYtitle keywords to specify the title , Y title
and X title for the entire matrix of plots (along with keywords like
mxTitSize=, mxTitOffset= to control the size and offset from the
axis.) For example,
erase & multiplot, [1,4], mXtitle='R', mYtitle='Compressional
Component [nT]'
for i=0,3 do begin
plot,indgen(10)
multiplot
endfor
multiplot,/reset
There are other keywords to control the size of the gaps between the
plots, or to force the individual plots to be square,
|
|
|
Re: One title to rule them all... [message #57569 is a reply to message #57568] |
Thu, 13 December 2007 07:16  |
lasse
Messages: 48 Registered: February 2007
|
Member |
|
|
On 13 Dec, 14:34, David Fanning <n...@dfanning.com> wrote:
> Lasse Clausen writes:
>> suppose I have a plot consisting of four panels on top of each other.
>> Let's also suppose all are showing the same quantity, just measured by
>> different instruments. Since the y axis title is rather longish - like
>> 'Compressional Component [nT]' - I would like one ytitle for all 4
>> panels.
>
>> I know that I could use YXOUTS to place a string next to the axes,
>> however I would need to work out exactly where to place it, so that it
>> appears centered. And I am anal about these things, if the title is
>> not exactly in the middle it will annoy the heck out of me. So I could
>> go about and use XYOUTS with negative character size to then have the
>> width of the string and so on and so on and so on... veeery
>> complicated. Though, now that I come to think of it, the time it takes
>> me to write this article would have been enough to write a little
>> procedure...
>
>> Anyway, I thought about using PLOT, /NODATA or AXIS but if I set
>> YSTYLE=5, then the title is also not drawn, which doesn't really help.
>> I also thought about drawing the axis in !P.BACKGROUND but... well, I
>> let you work out how pointless this approach is...
>
> No one is more anal about these kinds of things than I am,
> but this doesn't seem like a particularly big deal to me.
> Do everything in normalized coordinates. You can find you
> bearings with [!X, !Y].window. You can easily rotate your
> title text with XYOUTS and center it with ALIGNMENT=0.5,
> no need to fuss about string length at all. The AXIS
> command will put an axis anywhere you like.
>
> 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.")
The ALIGNMENT argument! Love it! Exactly what I wanted, let IDL do all
the string length calculations and whatnot.
Cheers
Lasse
PS: Wouldn't be too sure about the "No one is more anal about these
kinds of things than I am"...
|
|
|
Re: One title to rule them all... [message #57570 is a reply to message #57569] |
Thu, 13 December 2007 06:34  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Lasse Clausen writes:
> suppose I have a plot consisting of four panels on top of each other.
> Let's also suppose all are showing the same quantity, just measured by
> different instruments. Since the y axis title is rather longish - like
> 'Compressional Component [nT]' - I would like one ytitle for all 4
> panels.
>
> I know that I could use YXOUTS to place a string next to the axes,
> however I would need to work out exactly where to place it, so that it
> appears centered. And I am anal about these things, if the title is
> not exactly in the middle it will annoy the heck out of me. So I could
> go about and use XYOUTS with negative character size to then have the
> width of the string and so on and so on and so on... veeery
> complicated. Though, now that I come to think of it, the time it takes
> me to write this article would have been enough to write a little
> procedure...
>
> Anyway, I thought about using PLOT, /NODATA or AXIS but if I set
> YSTYLE=5, then the title is also not drawn, which doesn't really help.
> I also thought about drawing the axis in !P.BACKGROUND but... well, I
> let you work out how pointless this approach is...
No one is more anal about these kinds of things than I am,
but this doesn't seem like a particularly big deal to me.
Do everything in normalized coordinates. You can find you
bearings with [!X, !Y].window. You can easily rotate your
title text with XYOUTS and center it with ALIGNMENT=0.5,
no need to fuss about string length at all. The AXIS
command will put an axis anywhere you like.
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: One title to rule them all... [message #57572 is a reply to message #57570] |
Thu, 13 December 2007 04:40  |
ben.bighair
Messages: 221 Registered: April 2007
|
Senior Member |
|
|
On Dec 13, 6:02 am, Lasse Clausen <la...@lbnc.de> wrote:
> Greetings,
>
> suppose I have a plot consisting of four panels on top of each other.
> Let's also suppose all are showing the same quantity, just measured by
> different instruments. Since the y axis title is rather longish - like
> 'Compressional Component [nT]' - I would like one ytitle for all 4
> panels.
>
> I know that I could use YXOUTS to place a string next to the axes,
> however I would need to work out exactly where to place it, so that it
> appears centered. And I am anal about these things, if the title is
> not exactly in the middle it will annoy the heck out of me. So I could
> go about and use XYOUTS with negative character size to then have the
> width of the string and so on and so on and so on... veeery
> complicated. Though, now that I come to think of it, the time it takes
> me to write this article would have been enough to write a little
> procedure...
>
> Anyway, I thought about using PLOT, /NODATA or AXIS but if I set
> YSTYLE=5, then the title is also not drawn, which doesn't really help.
> I also thought about drawing the axis in !P.BACKGROUND but... well, I
> let you work out how pointless this approach is...
>
Hi,
That is the best post title we have seen in a long time!
I wonder if David Fanning's Str_Size( ) would be helpful? Check out
http://dfanning.com/tips/stringsize.html Knowing the string size and
the normalized bounding coordinates of the plots (check out the !X
and !Y variables) should give you pretty darn good control of the text
location.
Cheers,
Ben
|
|
|