Re: Multiple xaxis labels [message #58403] |
Mon, 28 January 2008 10:26 |
Brian Larsen
Messages: 270 Registered: June 2006
|
Senior Member |
|
|
On Jan 28, 12:59 pm, Bill Gallery <wgall...@aer.com> wrote:
> Brian,
>
> Better yet, see the system variable !xtickformat:
>
> "Set this keyword to a string or a vector of strings. The string can
> be a format string or a string containing the name of a function that
> returns a string to be used to format the axis tick mark labels. If a
> vector is provided, each string corresponds to a level of the axis.
> " (see idl help on !xtickformat for more information.)
>
> You need to provide a function to format the labels for each level,
> then set:
>
> !xtickformat=['label_funct_1', 'label_funct_2, ...]
>
> This should do what you want.
>
> Cheers,
>
> Bill
Bill, that does look like it will work well, In my initial playing it
does not seem to be the most intuitive thing but so many things in IDL
are not that I am getting more and more used to them. Like the extra
"axis" that is drawn by default, but I have seen in help somewhere
examples that did not have that.
Cheers,
Brian
------------------------------------------------------------ --------------
Brian Larsen
Boston University
Center for Space Physics
|
|
|
Re: Multiple xaxis labels [message #58404 is a reply to message #58403] |
Mon, 28 January 2008 09:59  |
wgallery
Messages: 32 Registered: December 1998
|
Member |
|
|
Brian,
Better yet, see the system variable !xtickformat:
"Set this keyword to a string or a vector of strings. The string can
be a format string or a string containing the name of a function that
returns a string to be used to format the axis tick mark labels. If a
vector is provided, each string corresponds to a level of the axis.
" (see idl help on !xtickformat for more information.)
You need to provide a function to format the labels for each level,
then set:
!xtickformat=['label_funct_1', 'label_funct_2, ...]
This should do what you want.
Cheers,
Bill
On Jan 28, 12:15 pm, Bill Gallery <wgall...@aer.com> wrote:
> Brian,
>
> Check out the 'label_date' function in idl help. That function allows
> you to put multiple line date/time labels on plots (see the examples
> at the end of the help page.) You may be able to tweak it to do what
> you want.
>
> Cheers
>
> Bill Gallery
>
> On Jan 28, 12:04 pm, pgri...@gmail.com wrote:
>
>> You may try adding !C to the ticknames:
>
>> plot,[1,2,1],xtickname=['','','1!C1']
>
>> Cheers,
>> Paolo
>
>> Brian Larsen wrote:
>>> IDLers,
>
>>> OK, so I have not found the good solution for making multiple labels
>>> on an axis. The example I am trying to emulate is:
>>> http://sprg.ssl.berkeley.edu/fast/sumplotProg/sumplotsLink/o rbit_link...
>
>>> It seems that I cant figure out how to:
>>> - put them in the right place with xyouts
>>> - line them up nicely
>>> - make sure they are in the right place
>
>>> Has anyone done this with good success?
>
>>> I know how with separate axes like:http://www.dfanning.com/graphics_tips/wavenumber.html
>>> but on the same axis has got me more boggled.
>
>>> Cheers,
>
>>> Brian
>
>>> ------------------------------------------------------------ --------------
>>> Brian Larsen
>>> Boston University
>>> Center for Space Physics
|
|
|
Re: Multiple xaxis labels [message #58407 is a reply to message #58404] |
Mon, 28 January 2008 09:19  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Brian Larsen writes:
> OK, so I have not found the good solution for making multiple labels
> on an axis. The example I am trying to emulate is:
> http://sprg.ssl.berkeley.edu/fast/sumplotProg/sumplotsLink/o rbit_links/2008/46118/2008_01_24/fa_k0_ees_46118_is.gif
>
> It seems that I cant figure out how to:
> - put them in the right place with xyouts
> - line them up nicely
> - make sure they are in the right place
>
> Has anyone done this with good success?
>
> I know how with separate axes like: http://www.dfanning.com/graphics_tips/wavenumber.html
> but on the same axis has got me more boggled.
Well, I would use the information in !Y.CRANGE (data
coordinates) or in !Y.WINDOW (normalized coordinates)
to help me align the extra annotation in the Y direction
(ALIGN=0.5 on your XYOUTS command, after you rotate it).
Positioning in the X direction is usually done more
empirically. (That is to say, you have to try it 2-3 times,
usually.) But if you base if off of !X.CRANGE[0] or
!X.WINDOW[0] you can usually find the right place in a matter
of seconds.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Multiple xaxis labels [message #58408 is a reply to message #58407] |
Mon, 28 January 2008 09:15  |
wgallery
Messages: 32 Registered: December 1998
|
Member |
|
|
Brian,
Check out the 'label_date' function in idl help. That function allows
you to put multiple line date/time labels on plots (see the examples
at the end of the help page.) You may be able to tweak it to do what
you want.
Cheers
Bill Gallery
On Jan 28, 12:04 pm, pgri...@gmail.com wrote:
> You may try adding !C to the ticknames:
>
> plot,[1,2,1],xtickname=['','','1!C1']
>
> Cheers,
> Paolo
>
> Brian Larsen wrote:
>> IDLers,
>
>> OK, so I have not found the good solution for making multiple labels
>> on an axis. The example I am trying to emulate is:
>> http://sprg.ssl.berkeley.edu/fast/sumplotProg/sumplotsLink/o rbit_link...
>
>> It seems that I cant figure out how to:
>> - put them in the right place with xyouts
>> - line them up nicely
>> - make sure they are in the right place
>
>> Has anyone done this with good success?
>
>> I know how with separate axes like:http://www.dfanning.com/graphics_tips/wavenumber.html
>> but on the same axis has got me more boggled.
>
>> Cheers,
>
>> Brian
>
>> ------------------------------------------------------------ --------------
>> Brian Larsen
>> Boston University
>> Center for Space Physics
|
|
|
Re: Multiple xaxis labels [message #58409 is a reply to message #58408] |
Mon, 28 January 2008 09:04  |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
You may try adding !C to the ticknames:
plot,[1,2,1],xtickname=['','','1!C1']
Cheers,
Paolo
Brian Larsen wrote:
> IDLers,
>
> OK, so I have not found the good solution for making multiple labels
> on an axis. The example I am trying to emulate is:
> http://sprg.ssl.berkeley.edu/fast/sumplotProg/sumplotsLink/o rbit_links/2008/46118/2008_01_24/fa_k0_ees_46118_is.gif
>
> It seems that I cant figure out how to:
> - put them in the right place with xyouts
> - line them up nicely
> - make sure they are in the right place
>
> Has anyone done this with good success?
>
> I know how with separate axes like: http://www.dfanning.com/graphics_tips/wavenumber.html
> but on the same axis has got me more boggled.
>
>
> Cheers,
>
> Brian
>
> ------------------------------------------------------------ --------------
> Brian Larsen
> Boston University
> Center for Space Physics
|
|
|