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

Home » Public Forums » archive » Date labeling in PLOT IDL8
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
Date labeling in PLOT IDL8 [message #76034] Fri, 13 May 2011 00:41 Go to next message
corinnefrey is currently offline  corinnefrey
Messages: 18
Registered: November 2006
Junior Member
Hello

I would like to annotate my x-axis with Monthes only. At the moment it
looks like this (just example data):

monthly_plot = PLOT(TIMEGEN(12, START=
JULDAY(1,1,2003,0,0,0),UNITS="Month"), FINDGEN(12),$
SYMBOL = 2, XTITLE = 'Month', XTICKUNITS=['Months'], XTICKLEN=1,
XMINOR= 0, CHARSIZE=1, XRANGE = xrange, YRANGE = [-10,15], XSTYLE = 1)

The beginning of each month label is now at the beginning of each
"tickmark-box". However, I would like to have it in the middle of each
two tickmarks. How can i do that?

Kind regards,
Corinne
Re: Date labeling in PLOT IDL8 [message #76257 is a reply to message #76034] Mon, 23 May 2011 01:31 Go to previous messageGo to next message
Klemen is currently offline  Klemen
Messages: 80
Registered: July 2009
Member
Hi, I had similar problems - I could not put the label in the middle
of the interval. I decided in the end to use LABEL_DATE function,
where I put some spaces in front of code for the month (%M). The
problem is, that IDL ignores all empty spaces if there is no other
charcter in front of it. So I made a compromise and put a point in the
beginning. If you look your graph long enough you will of course see
these points, but others will probably not notice it. :)

Cheers, Klemen

dat_form = LABEL_DATE(DATE_FORMAT='. %M %D') ;note
the point and spaces in front of %M

ka = PLOT([0], XRANGE = [xmin,xmax], YRANGE = [ymin,ymax], $
YTITLE='$\it$RP $\rm$[MW]', $ XTITLE='Date', $
SYM_SIZE = 0., FONT_SIZE= 8, FONT_NAME ='Arial', $
XTICKINTERVAL=1, XMINOR=3, XTICKLEN=0.03, YTICKLEN=0.03, $
XTICKUNITS='Day', XTICKFORMAT='LABEL_DATE', XTICKLAYOUT=0)
Re: Date labeling in PLOT IDL8 [message #76315 is a reply to message #76257] Thu, 26 May 2011 03:28 Go to previous message
corinnefrey is currently offline  corinnefrey
Messages: 18
Registered: November 2006
Junior Member
Hi Klemen,

Ok, not a bad idea, thanks. For publication however this will not
acceptable... I guess, I stay with the old plot procedure for this
kind of plots...

Cheers,

On May 23, 10:31 am, Klemen <klemen.zak...@gmail.com> wrote:
> Hi, I had similar problems - I could not put the label in the middle
> of the interval. I decided in the end to use LABEL_DATE function,
> where I put some spaces in front of code for the month (%M). The
> problem is, that IDL ignores all empty spaces if there is no other
> charcter in front of it. So I made a compromise and put a point in the
> beginning. If you look your graph long enough you will of course see
> these points, but others will probably not notice it. :)
>
> Cheers, Klemen
>
> dat_form = LABEL_DATE(DATE_FORMAT='.                  %M %D')   ;note
> the point and spaces in front of %M
>
> ka = PLOT([0], XRANGE = [xmin,xmax], YRANGE = [ymin,ymax], $
>      YTITLE='$\it$RP $\rm$[MW]', $ XTITLE='Date', $
>      SYM_SIZE = 0., FONT_SIZE= 8, FONT_NAME ='Arial', $
>      XTICKINTERVAL=1, XMINOR=3, XTICKLEN=0.03, YTICKLEN=0.03, $
>      XTICKUNITS='Day', XTICKFORMAT='LABEL_DATE', XTICKLAYOUT=0)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Nasty compatibility issue in lists and hashes (and maybe more?)
Next Topic: backward compatibility

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

Current Time: Wed Oct 08 15:16:27 PDT 2025

Total time taken to generate the page: 0.00674 seconds