comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Plotting a compass
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Plotting a compass [message #81917] Fri, 09 November 2012 11:01
DAVIDE LENA is currently offline  DAVIDE LENA
Messages: 22
Registered: September 2011
Junior Member
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.

Thanks in advance. Cheers.
Davide


p = [0.2,0.25,0.9,0.9] ; positions, put the image in a specific place in the window

; Arrows coordinates:
x0 = 0.8
y0 = 0.75
x1 = 0.85
y1 = 0.77

; slope of the first arrow:
m1 = (y1 - y0)/(x1 - x0)

x2 = 0.78
y2 = y0 - 1./m1 * (x2 - x0)

SET_PLOT, 'ps'
DEVICE, BITS_PER_PIXEL=8, /encapsulated, FILENAME = 'awesomeplot.eps', /portrait, FONT_SIZE=10, /color, xsize=24, ysize=42
erase
loadct, 3 ; "red temperature" table.
tvscale, f, /KEEP_ASPECT_RATIO, minvalue=minc, maxvalue=maxc, position=p, /scale, /axis, $
AXKEYWORDS={CHARSIZE:3, XTITLE:'x [arcsec]', YTITLE:'y [arcsec]', COLOR:0, yrange:[crpix2, (crpix2 - ny)]*cd1_1, xrange:[crpix1, (crpix1 - nx)]*cd2_2}
fsc_arrow, x0, y0, x1, y1, normal=1, COLOR = 'green'
fsc_arrow, x0, y0, x2, y2, normal=1, COLOR = 'green'
cgColorbar, FORMAT='(F2.0)', Position=[p[2], p[1], p[2]+0.015, p[3]], ncolors=256, /vertical, /right, Divisions=4, CHARSIZE=3, Range=[minc, maxc]

device, /close
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Coyote Library Updates
Next Topic: ASCII File reads of free format files

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:47:26 PDT 2025

Total time taken to generate the page: 0.00406 seconds