Mombu the Programming Forum

Go Back   Mombu the Programming Forum > Programming > overlaying arrow plots
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 17th September 21:08
metachronist
External User
 
Posts: 1
Default overlaying arrow plots



Dear All,

I started using IDL more only recently. So please be kind :-) I have
made arrow plots from a 1D timeseries using one_arrow, which in turn
calls one_ray. I want to be able to overlay these vector plots on maps
and regular x-y plots of the timeseries/other derived quantities.

I make the call to one_arrow after I plot the timeseries. The
postscript file I generated had only the timeseries plot and the arrows
were not plotted. However, I could overlay the 1D vector plot in the
plot window. Is this a problem with different coordinates(device/data?)

The call to one_arrow has the following arguments -
xcen,ycen,angle,label,charsize
where xcen, ycen = starting point of arrow in device coordinates,
floating point scalars.

I used convert_coord to convert the time indices (1sec
data-1,2,3,4,....etc.) to device coordinates and kept the second
coordinate, a constant. How can I overlay the arrowplots created from
the 1D timeseries on the same 'postscript' plot with the time series
and on a map projection? And is there a better way to tackle such
problems?

I don't know if it's been discussed before. I tried to read old posts,
but were mostly about velovect.

Any suggestions/help much appreciated.

tia,
~rk
  Reply With Quote


 


2 17th September 21:08
david fanning
External User
 
Posts: 1
Default overlaying arrow plots



metachronist writes:


Well, let's just say that of the three coordinate systems
available, you chose the only one that isn't going to
work for you in PostScript. :-)

Put your arrows and other overlays into DATA or NORMAL
coordinates and you will be golden.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Reply With Quote
3 17th September 21:09
wayne landsman
External User
 
Posts: 1
Default overlaying arrow plots


one_arrow and one_ray are old routines from the IDL Astronomy Library
and are not part of the standard IDL distribution. They only
accepted device coordinates, so you had to be careful to convert both
the arrow position and length to device coordinates. If you just
want to draw an arrow without annotation, then you might have better
luck with the standard IDL routine ARROW, which accepts /DATA and
/NORMAL keywords.

I have now updated one_arrow.pro so that it accepts both /DATA and
/NORMAL keywords (at http://idlastro.gsfc.nasa.gov/ftp/pro/misc/)

--Wayne
  Reply With Quote
4 17th September 21:09
metachronist
External User
 
Posts: 1
Default overlaying arrow plots


Hi Wayne,

Thanks for your time and help! Yes, I could overlay them arrows without
any problems now. I chose one_arrow because it accepts angles as input
(Maybe I could do the same with ARROW also, I haven't checked the
code/syntax yet.). My angles are time dependent.

Hmm, at first glance it seems like them arrows are inverted?? For
example, my min(angle) is 36.3610 and max(angle) is 124.032. So these
should be plotted pointing in the north-east and north-west
respectively?? I mean, aren't the angles counterclockwise from +x? The
directions were fine earlier. I didn't read your modifications yet. But
now directions seem off.
FYI,

After I do:
--
plot,time,tseries
--
I make a call to one_arrow via:
--
for i=0,n_elements(tseries)-1 do $
one_arrow,time(i),zeroarray(i),angle[i],'',arrowsize=[(angle[i]/maxangle),9.0,35.0],charsize=0.1,thick=1.
--
Thanks for the modifications and the help!
Cheers,
/rk
  Reply With Quote
Reply


Thread Tools
Display Modes




666