Date labeling in PLOT IDL8 [message #76034] |
Fri, 13 May 2011 00:41  |
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   |
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  |
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)
|
|
|