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

Home » Public Forums » archive » Retrieving labels of tick marks
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
Retrieving labels of tick marks [message #89355] Tue, 26 August 2014 14:10 Go to next message
elias is currently offline  elias
Messages: 13
Registered: April 2005
Junior Member
Hi,

I was wondering if it is possible to retrieve the string array of the tick labels that IDL generates for a plot? As far as I know, one may retrieve the tick values with tick_get.

What I want to do is to modify the output of label_date. For the day number, LABEL_DATE outputs only the day of month, but sometimes I prefer to have the day of year (e.g. 184/2014 instead of 01-Jul-2014). My idea is to retrieve the output of LABEL_DATE and replace the month/day-of-month with DOY, using one of the JHUAPL routines.

Do you suggest a different method otherwise?

Thanks.
Re: Retrieving labels of tick marks [message #89366 is a reply to message #89355] Wed, 27 August 2014 17:19 Go to previous message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
You can write your own tick-label formatting function.

Say your time axis is given in julian day numbers:

MyDates = TIMEGEN(366, START=JULDAY(1,1,2000))

You can create you own function to convert axis labels to dates:

function xtick_time_labels, axis, index, value, level
caldat, value, month, day, year
year_day = Convert2YearDay(month, day, year)
tick = strtrim(year_day, 2) + '-' + strtrim(year, 2)

return, tick
end


then use the XTICKFORMAT keyword in the plot command.

plot, MyDates, MyData, XTICKFORMAT='xtick_time_labels'


http://exelisvis.com/docs/graphkeyw.html#graphkeyw_328877816 6_370350
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Point Matching...
Next Topic: does restoring sav file routines open the way to some sort of decompilation?

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

Current Time: Wed Oct 08 11:27:26 PDT 2025

Total time taken to generate the page: 0.00477 seconds