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

Home » Public Forums » archive » Re: Common x- and y-axes labels.....
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: Common x- and y-axes labels..... [message #65383] Mon, 02 March 2009 11:58
Christopher Thom is currently offline  Christopher Thom
Messages: 66
Registered: October 2006
Member
Quoth bobbylough:

> Dear all,
>
> I was wondering whether it was possible to construct in IDL a common x-
> and y-axis annotation for a matrix of plots. I have a 2*6 matrix of
> plots and would like to produce an figure displaying all 12 plots along
> with a just the one x- and y- labeling, which would be positioned
> somewhere near the centre of each ordinate. Thanks in advance.......

If you want all the plots to share common axes too (i.e. no interior space
between your plots), then check out "mulitplot" in the idlastro library.

http://idlastro.gsfc.nasa.gov/ftp/pro/plot/multiplot.pro

Actually, I just checked the routine -- the latest version has keywords
for adding spaces between plots, and labelling the common axes.

cheers
chris
Re: Common x- and y-axes labels..... [message #65391 is a reply to message #65383] Mon, 02 March 2009 07:33 Go to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Mar 2, 8:58 am, David Fanning <n...@dfanning.com> wrote:
> David Gell writes:
>> You can use the graphics keywords [xy]tickname to suppress the tick
>> labels on all but the desired plot.
>
> I usually suppress tick labels like this:
>
>    IDL> plot, findgen(11), xtickformat='(A1)'
>
> I don't know WHY it works, but it does.
>
> I haven't been able to figure out what the user wanted
> to do either, so I haven't commented, but I did have
> something totally different from this in mind. :-)
>
> 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.")

It works because the string representation of any number in IDL is
a) right-justified
b) always has leading spaces

So if you take the first character of that, it's always a space... and
is therefore exactly equivalent to DG's replicate(' ',N).

-Jeremy.
Re: Common x- and y-axes labels..... [message #65394 is a reply to message #65391] Mon, 02 March 2009 05:58 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Gell writes:

> You can use the graphics keywords [xy]tickname to suppress the tick
> labels on all but the desired plot.

I usually suppress tick labels like this:

IDL> plot, findgen(11), xtickformat='(A1)'

I don't know WHY it works, but it does.

I haven't been able to figure out what the user wanted
to do either, so I haven't commented, but I did have
something totally different from this in mind. :-)

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: Common x- and y-axes labels..... [message #65396 is a reply to message #65394] Mon, 02 March 2009 05:36 Go to previous message
David Gell is currently offline  David Gell
Messages: 29
Registered: January 2009
Junior Member
On Feb 28, 1:38 pm, bobbylough <loughnane.rob...@gmail.com> wrote:
> Dear all,
>
> I was wondering whether it was possible to construct in IDL a common
> x- and y-axis annotation for a matrix of plots. I have a 2*6 matrix of
> plots and would like to produce an figure displaying all 12 plots
> along with a just the one x- and y- labeling, which would be
> positioned somewhere near the centre of each ordinate. Thanks in
> advance.......
>
> Regards,
> Robert.

I assume that the idea is to have twelve plots in two columns with
axis annotations on one plot near the center of the matrix. The code
might look something like

for nI=0,1 do begin
for nJ=0,5 do begin

;;compute position of plot

plot, x[*,ni,nj], y[*,ni,nj], ...

endfor
endfor

You can use the graphics keywords [xy]tickname to suppress the tick
labels on all but the desired plot. You can also use [xy]title to
specify the axis title for the plots you want. In the example above
use something like

xtickname= ((ni eq 1) && nJ eq 2) ? '' : replicate(' ', 30)
xtitle = ((ni eq 1) && nJ eq 2) ? 'this is the x axis' : ' '

If you specify a null string with the xtickname keyword, IDL labels
the ticks, if you specify an array IDL uses the array. So to label the
tickmarks on one axis in the set, supply the null string to xtick name
for the plot you want labeled and an array of blanks for those you
don't.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Get time and date from a server using a socket
Next Topic: the problem of using CALL_EXTERNAL()

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

Current Time: Fri Oct 10 09:07:34 PDT 2025

Total time taken to generate the page: 0.79745 seconds