Re: Can ARROW be used with PLOT [message #40427] |
Wed, 04 August 2004 21:00 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Edwin writes:
> I'm making a simple XY plot using
>
> plot, x, y
>
> where x and y are arrays.
>
> I want to draw some arrows onto this plot.
>
> I was thinking of using ARROW procedure, so I wrote this as a test:
>
> ---
> x=[0,1,2,3,4,5]
> y=[0,1,4,9,16,25]
> PLOT, x, y, background=-1, color=0
> ARROW, 100, 150, 300, 350
> ---
>
> where the arrow coordinates are in DEVICE units (pixels). When I run
> this code, all I get is the expected parabolic curve. I do not get an
> arrow on the plot. If I comment out lines 1 to 3 and just run the
> arrow line, the arrow does appear. It appears I can't do them
> simultaneously. If so, what other way is there for me to make arrows
> appear on my plot? (I want to use arrows to point out peaks of
> interest in my graph).
It seems more likely to me that you are drawing a black
arrow on a black background (or maybe white on white).
(And what in the world does BACKGROUND=-1 do!?)
Try you plot with a normal color table and no color
keywords and see what you get. :-)
Cheers,
David
P.S. And I think you will have more luck drawing
your arrow in DATA coordinates, especially if you
want to create the plot in PostScript, eventually.
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|