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

Home » Public Forums » archive » Axis labeling trickery
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: Axis labeling trickery [message #85784 is a reply to message #85783] Sat, 07 September 2013 12:47 Go to previous messageGo to previous message
Paul Levine is currently offline  Paul Levine
Messages: 29
Registered: February 2008
Junior Member
On 2013-09-07 18:50:22 +0000, Phillip Bitzer said:

> On Friday, September 6, 2013 6:18:06 PM UTC-5, Paul Levine wrote:
>
>> Example 1:
>> time = timegen(120,start=julday(1,1,2003), units='M', step_size=1)
>>
>> data = 20*randomu(seed,n_elements(time))-10
>>
>> void = Label_Date(Date_Format='%Y')
>>
>> cgPlot, time, data, xrange=[julday(1,1,2003),julday(12,31,2012)],
>>
>> XTickFormat='Label_Date', XTicks = 10
>>
>
> Looks like this example gives me something different - 2003-2012 is the
> range of the labels. No 2013, but 2004 and 2008 are duplicated and 2005
> is missing. XTicks=9 gives the correct labels, though (ten year span =>
> 9 tick intervals and 10 tickmarks).
>
> Just for reference:
> IDL> print, !VERSION
> { x86_64 darwin unix Mac OS X 8.2.2 Jan 23 2013 64 64}

I mixed up a line in my example, so the results (same as what you got)
are different than what I described. What I should have written was to
have the end of xrange be julday(1,1,2013) rather than
julday(12,31,2012), which would have produced what I described, so:

time = timegen(120,start=julday(1,1,2003), units='M', step_size=1)
data = 20*randomu(seed,n_elements(time))-10
void = Label_Date(Date_Format='%Y')
cgPlot, time, data, xrange=[julday(1,1,2003),julday(1,1,2013)],
XTickFormat='Label_Date', XTicks = 10


Either way, though, the problem with setting XTicks = 9 is that while
the year labels print what I want, the tick marks themselves are no
longer spaced one year apart on January 1 of each year. Running the
same code above but with Date_Format='%M %D %Y') and XTicks=9
illustrates why I need 10 rather than 9 tick intervals.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: really dumb widget question
Next Topic: Unable to allocate memory

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

Current Time: Wed Oct 08 17:32:11 PDT 2025

Total time taken to generate the page: 0.00427 seconds