Re: Plotting a compass [message #81905 is a reply to message #81904] |
Fri, 09 November 2012 14:26   |
DAVIDE LENA
Messages: 22 Registered: September 2011
|
Junior Member |
|
|
Thanks.
So, how do I put a colorbar when I use cgImage to print on a eps?
cgColorbar comes after the instruction that directs the output to the eps.
cgIMAGE, f, POSITION=p, /KEEP_ASPECT_RATIO, MINVALUE = 0, outfilename='wanderfulplot.eps', OUTPUT = 'EPS'
cgColorbar, FORMAT='(F2.0)', Position=[p[2], p[1], p[2]+0.015, p[3] ], ncolors=256, /vertical, /right, Divisions=4, Range=[minc, maxc]
For what concerns the arrows, I guess that the problem is that I am using normal coordinates, that's why they are not orthogonal. I should switch to the data coordinates. Anyway, they look the same than the arrows obtained with the old function.
On Friday, November 9, 2012 2:36:01 PM UTC-5, David Fanning wrote:
> Davide writes:
>
>
>
>> Hi guys, I am trying to plot something like a compass on top of an image (a 2D matrix filled with floats. It is supposed to be a flux map for an astronomical object. No reliable wcs system inside). So I ended up using "arrow".
>
>> I am having difficulties plotting two orthogonal arrows. The code (see below) seems fine to me. Is that something related to some rescaling? (Or maybe I made some awkward mistake).
>
>> Also, can you suggest something more up to date than tvscale? Consider that my goal is have maps with a color bar and spatial scales along x and y.
>
>
>
> Oh, dear! :-(
>
>
>
> I don't know where to start. I guess I'd start
>
> by updating your Coyote Library to something
>
> that was written in the, I don't know, last 10
>
> years or so. Things have changed. In fact, things
>
> have changed TODAY!
>
>
>
> http://www.idlcoyote.com/programs/coyoteprograms.zip
>
>
>
> Humm. The cgImage program is perfectly capable of adding
>
> axes with different ranges so you can set up a data
>
> coordinate system, etc. And cgArrow can make prettier
>
> arrows than you are making.
>
>
>
> I guess if I were going to think about drawing orthogonal
>
> vectors I would be thinking about working in polar coordinates,
>
> rather than rectangular coordinates. The angle thing would
>
> be a LOT easier! You can use CV_COORD to do the conversions
>
> for you.
>
>
>
> Weird dimensions on the PostScript file, too. What are
>
> you going to do with that thing when you are done with it?
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|