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 #85797 is a reply to message #85795] Mon, 09 September 2013 15:33 Go to previous messageGo to previous message
suicidaleggroll is currently offline  suicidaleggroll
Messages: 14
Registered: September 2013
Junior Member
On Monday, September 9, 2013 3:59:10 PM UTC-6, Paul Levine wrote:
> On 2013-09-07 19:56:40 +0000, Fabien said:
>
>
>
>> Hi,
>
>>
>
>> I am not sure to understand the problem but I know that label_date can
>
>> be very annoying sometimes ...
>
>>
>
>> What about doing the same, but without label_date?
>
>>
>
>> time = timegen(120,start=julday(1,1,2003), units='M', step_size=1)
>
>> data = 20*randomu(seed,n_elements(time))-10
>
>> ; Without "label_date"
>
>> x_name = STRING(INDGEN(11) + 2003, FORMAT='(I04)')
>
>> x_locs = timegen(11,start=julday(1,1,2003), units='Y', step_size=1)
>
>> cgPlot, time, data, xrange=[julday(1,1,2003),julday(1,1,2013)], $
>
>> XTICKV=x_locs, XTicks=10, XTICKNAME=x_name
>
>>
>
>> Cheers,
>
>>
>
>> Fab
>
>
>
> Thank you for the suggestion. But that gives the same result as my
>
> first example
>
>
>
> 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
>
>
>
> in which there is a label at the "end" of the x-axis for the 11th year.
>
> I guess what I am wanting to do is to have 10 tick intervals, but only
>
> 10 labels, with the 11th tick mark remaining unlabeled. If it can't be
>
> done from within the plot or axis routines, I will just have to use
>
> xyouts (or cgText).

Why not just use xtickv and xtickname to put the labels you want, where you want, called what you want.

years=indgen(10)+2003
xtickv=julday(1,1,years,0)
xtickname=string(years,format='(i4.4)')
plot, time, data, xrange=julday(1,1,[2003,2013]), xtickv=xtickv, xtickname=xtickname, xticks=n_elements(xtickv)-1

or similar
[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 19:32:48 PDT 2025

Total time taken to generate the page: 0.00482 seconds