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

Home » Public Forums » archive » Reversing y-axis using label_date
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
Reversing y-axis using label_date [message #89721] Wed, 19 November 2014 23:13 Go to next message
greer.katelynn is currently offline  greer.katelynn
Messages: 5
Registered: December 2008
Junior Member
I am attempting to create a Hovmoller plot of some atmospheric data. The problem is that I want time increasing downward. Usually to reverse the an axis, you just reverse the range in the plot call. Unfortunately, this is resulting in only one date to be plotted. The relevant code is as follows:

cgLoadCT,22,Ncolors=21,Bottom=1,/Brewer
dummy=label_date(DATE_FORMAT=['%D','%M'])
plot,[0,10],[juldates(1),juldates(2)],/nodata,$
xrange=[-180,180],yrange=[juldates(nt-1),juldates(0)],$
ytickunits=['Time','Time'],ytickinterval=2,$
ytickformat='Label_Date',xtitle='Longitude',$
xstyle=1,ystyle=1
contour,w,lon,juldates,$
levels=w_levels,c_colors=Indgen(21),/cell_fill,$
/overplot

Thanks,
Katelynn
Re: Reversing y-axis using label_date [message #89725 is a reply to message #89721] Thu, 20 November 2014 05:13 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
greer.katelynn writes:

>
> I am attempting to create a Hovmoller plot of some atmospheric data. The problem is that I want time increasing downward. Usually to reverse the an axis, you just reverse the range in the plot call. Unfortunately, this is resulting in only one date to be plotted. The relevant code is as follows:
>
> cgLoadCT,22,Ncolors=21,Bottom=1,/Brewer
> dummy=label_date(DATE_FORMAT=['%D','%M'])
> plot,[0,10],[juldates(1),juldates(2)],/nodata,$
> xrange=[-180,180],yrange=[juldates(nt-1),juldates(0)],$
> ytickunits=['Time','Time'],ytickinterval=2,$
> ytickformat='Label_Date',xtitle='Longitude',$
> xstyle=1,ystyle=1
> contour,w,lon,juldates,$
> levels=w_levels,c_colors=Indgen(21),/cell_fill,$
> /overplot

This has something to do with the YTICKUNITS keyword. When this is set
the way it is in your example, the wrong information (actually the SAME
information, over and over) is sent to LABEL_DATE. If you simply remove
the YTICKUNITS keyword, the time axis behaves the way you expect it to.

I have no idea what this is about, but expect it is a bug in IDL.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: extrac subarrays
Next Topic: How to convert Julian date into Gregorian date format in IDL?

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

Current Time: Wed Oct 08 11:40:16 PDT 2025

Total time taken to generate the page: 0.00495 seconds