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

Home » Public Forums » archive » Re: HELP: IDL Aspect problem on contour plots
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
Re: HELP: IDL Aspect problem on contour plots [message #2755] Thu, 22 September 1994 06:05
landers is currently offline  landers
Messages: 45
Registered: May 1993
Member
iotov@cco.caltech.edu (Mihail S. Iotov) writes:
|> This is a seemingly trivial question that we could not solve by poking into the
|> manuals.
|>
|> The contour plot comes fine, but the scale on the x axis is twice that on the y
|> axis. So the whole picture is stretched in one direction.
|> Is there a way to fix this.
|>
|> Thanks a lot,
|> Mihail Iotov
|>

To make a plot come out square on your paper or display, you do some thing(s)
like this:


; First, you must make a plot to establish the plot coordinates
; Use NoData, and [XY]Style=4 to keep from drawing anything
; The NoErase is there to prevent an extra blank sheet of paper
; if you are using a paper-based device

plot, [0], /Nodata, XStyle=4, YStyle=4, /NoErase

; Now you can determine where this plot is:
; these are 2-element vectors in device coords

px = !x.window * !d.x_vsize
py = !y.window * !d.y_vsize

; and it's size

sx = px(1) - px(0)
sy = py(1) - py(0)

; now shrink the larger one to force the plot area to be square
; with a bit more thought, you could come up with any aspect ratio

wx = sx < sy
wy = wx

; figure the center of the plot space
; well, twice the center location

cx = px(0)+px(1)
cy = py(0)+py(1)

; Set a position vector
; re-center the plot in the available area

pos = [ cx-wx, cy-wy, cx+wx, cy+wy ] / 2.

; now you can make your plot, contour, etc...

plot, whatever, Position=pos

contour, things, Position=pos

; etc...


--
;Dave
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: opening files under IDL problem
Next Topic: Re: opening files under IDL problem

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

Current Time: Thu Oct 09 06:45:19 PDT 2025

Total time taken to generate the page: 1.04104 seconds