Re: plot, xtickname [message #13139 is a reply to message #13131] |
Tue, 20 October 1998 00:00  |
harald
Messages: 5 Registered: October 1998
|
Junior Member |
|
|
On Mon, 19 Oct 1998 17:34:51 GMT, campo9729@my-dejanews.com wrote:
> i am doing a tv command and then a plot command to create axes around
> the image. i would like to use the plot command and exactly specify
> the x axis tick names that i want. here is my array of xaxis names in
> this order:
>
> xaxis=[0,2,4,6,20,33,40,6,9,15,25,35]
> xaxis=string(xaxis)
>
> but i am unsure which keywords to use.
> (in my case my xaxis array will be much longer, but i don't
> even know how to do this example case.)
You could use the XTICKFORMAT keyword together with the XTICKS and
XMINOR keywords (see IDL documentation).
Try the following:
;----------------------------------------------------------- ------------------------
FUNCTION Get_Label, axis, index, value
xaxis=STRING([0,2,4,6,20,33,40,6,9,15,25,35])
RETURN, xaxis[index]
END
WINDOW, XSIZE=400, YSIZE=400
image = DIST(300)
TVSCL, image, 50, 50
PLOT, [0], XTICKS=11, XMINOR=1, XTICKFORMAT='Get_Label', $
YTICKS=1, YMINOR=1, YTICKFORMAT='(A1)', $
POSITION=[50,50,349,349], /NOERASE, /DEVICE
END
;----------------------------------------------------------- -----------------------
The keyword YTICKFORMAT='(A1)' suppresses the y-axis annotation.
Regards,
Harald
------------------------------------
Harald Jan Jeszenszky
harald@iwf.tu-graz.ac.at
Space Research Institute
Austrian Academy of Sciences
------------------------------------
|
|
|