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

Home » Public Forums » archive » How to label a time axes on an image?
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: How to label a time axes on an image? [message #93222 is a reply to message #93219] Mon, 16 May 2016 05:07 Go to previous messageGo to previous message
steven.abel is currently offline  steven.abel
Messages: 13
Registered: April 2016
Junior Member
On Monday, 16 May 2016 12:26:47 UTC+1, Steve wrote:
> Hi
>
> I am having trouble labeling a time axis on an image. Here is some test code
>
> ;create a randomn image for testing
> data = RANDOMU(seed,1800,401)
> img = BYTSCL(data)
>
> ;data values that I would like to use for labeling the axes
> xval = FINDGEN(1800)/(60.*60.*24.) + JULDAY(11,24,2014,11,15,00)
> yval = FINDGEN(401)-200.
>
> ;plot the image and label the axes
> im = IMAGE(img, RGB_TABLE=0,MARGIN=0.2)
> yax = AXIS('Y', LOCATION=[0,0], TICKDIR=1, MINOR=0, COORD_TRANSFORM=[yval[0],1])
> xax = AXIS('X', LOCATION=[0,0], TICKDIR=1, MINOR=0, TICKFORMAT='(C(CHI2.2, ":", CMI2.2))', COORD_TRANSFORM=[xval[0],1.])
>
> I am using COORD_TRANSFORM in the call to AXIS to try and convert the pixel number of the image to what I would like to display. In the example above this works for the yaxis which simply changes the axis data values. For the xaxis I am also trying to display it in a time format as HH:MM but all of the axes labels display as 00:00.
>
> Any idea how I can label the xaxis correctly?
>
> Thanks
>
> Steve

Just spotted an error in my test code. The xaxis should be

xax = AXIS('X', LOCATION=[0,0], TICKDIR=1, MINOR=0, TICKFORMAT='(C(CHI2.2, ":", CMI2.2))', COORD_TRANSFORM=[xval[0],1./(60.*60.*24.)])

This does put what look to be about the correct times but they all overlay each other on the axis. Something is not quite right!

Steve
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: plot data
Next Topic: Convert Function to Procedure

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

Current Time: Fri Oct 10 17:02:20 PDT 2025

Total time taken to generate the page: 0.56144 seconds