Re: CAT, DOG, 1.7 AND FISH IN IDL [message #32951] |
Mon, 18 November 2002 21:03 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
MC (markchan@shaw.ca) writes:
> To Group,
>
> x=[2,4,6,8]
> y=[200,400,600,800]
> plot,x,y
>
> One gets a plot. But not what I want.
>
> I need to replace the x-axis with the following axis:
>
> where x=2, a label 'cat'
> where x=4, a label 'dog'
> where x=6, a label '1.7'
> where x=8, a label 'fish'
>
> I know how to suppress the original x-axis, but don't know how to put the
> new one in. I am not into object graphic either.
That's too bad about the object graphics thing. It would
be so elegant, and only take about 45 minutes. :-)
How about something like this then.
FUNCTION animal_names, axis, index, value
names = ['cat', 'dog', '1.7', 'fish']
RETURN, names[index]
END
x=[2,4,6,8]
y=[200,400,600,800]
plot,x,y, XTickformat='Animal_Names'
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|