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

Home » Public Forums » archive » Re: labels for multiple x axis
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: labels for multiple x axis [message #42179] Thu, 06 January 2005 13:23 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
Mark Hadfield wrote:
> Lasse Clausen wrote:
>
>> I am using the following code to produce a nice, extensively boring
>> plot.
>>
>> PLOT,FINDGEN(100),XTICKS=2,XTICKUNITS=['NUMERIC','NUMERIC'], $
>> POSITION=[.05,.2,.95,.8]
>>
>> The question is: How do I get IDL to use the XTICKS keyword for the
>> second axis as well? Because it uses 3 ticks for the first, but 6
>> ticks for the second axis.
>
> Ditch the 2-element array for XTICKUNITS, thus:
>
> PLOT,FINDGEN(100),XTICKS=2,XTICKUNITS='NUMERIC',$
> POSITION=[.05,.2,.95,.8]
>
> Array values for XTICKUNITS are only relevant for multi-level axes,
> which are something else entirely. (If you run your command without the
> POSITiON keyword, you will see a second x axis at the bottom of the plot.).

Lasse replied to me by email (because he couldn't reply on the newsgroup
for some reason). To keep things on the record, I am quoting his reply
and responding here

> Oh, I think you got me wrong there. I *want* a multi-level x axis.
> But I want both of the multi-level axis to have the same amount of
> xticks (namely 3). But what IDL does is that is put 3 ticks on the
> first x axis (as defined by xticks), then 6 on the second one.
> And it seems as if I cannot influence the number of ticks on the
> second of the multi-level axis. And by the way, the position keyword
> is set to be able to see the secondary x-axis in its full beauty.

Oh. The obvious way to do what you want is to set XTICKS=[2,2], but IDL
won't let you do that:

PLOT,FINDGEN(100),XTICKS=[2,2],XTICKUNITS=['NUMERIC','NUMERI C'], $
POSITION=[.05,.2,.95,.8]
% PLOT: Expression must be a scalar or 1 element array in this context:
<LONG Array[2]>

By the way, have you noiiced with your original command that the upper X
axis has tick labels "0", "50" & "100" (which is reasonable) and the
lower X axis has labels "0", "50", "100", "60", "80", "100" (which is
rubbish)?

IMHO IDL multi-level axes are incompletely thought out & carelessly
implemented and so are not worth bothering with.


--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
[Message index]
 
Read Message
Read Message
Previous Topic: Re: CW_FILESEL size
Next Topic: plotting rotating vectors in a sequence

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

Current Time: Sat Oct 11 11:18:42 PDT 2025

Total time taken to generate the page: 0.63999 seconds