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

Home » Public Forums » archive » Re: Q: square plots in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Q: square plots in IDL [message #3246] Mon, 28 November 1994 09:57 Go to previous message
sjt is currently offline  sjt
Messages: 72
Registered: November 1993
Member
Giuseppe Vacanti (gvacanti@estsa2.estec.esa.nl) wrote:

: Hello-

: I would like to plot data so that the aspect ratio of the plot is
: equal to 1 (a circle would actually be a circle on paper, and not
: an ellipse, as it is in my IDL documentation). I have played with
: various key-words but I don't seem able to get it right.

: Any input is welcome.
: Thanks,

An initial point:
Unless you have made a square page with the WINDOW procedure or a
DEVICE call (depending on your device) avoid using procedures which set
up data coordinates implicitly (e.g. PLOT, SURFACE etc.).

Instead you will need to create your own plot transform.

1) Determine size of device each way in cm
xcm = !d.x_size/float(!d.x_px_cm)
ycm = !d.y_size/float(!d.y_px_cm)

2) Determine your scaling factor (user unit/cm)(assume xr, yr are the ranges
of x and y that you need).

xscl = xr/xcm
yscl = yr/ycm
scl = xscl > yscl

3) Define your plot transform (assume xm, ym are the minimum x and y you
want to plot)

!x.s = [-xm, 1.]/(scl*xcm)
!y.s = [-ym, 1.]/(scl*ycm)

This seemed to work when I tested it to plot a unit circle in an 800x437
pixel window using PLOTS

: --

: Giuseppe Vacanti
: Astrophysics Division / SERCO
: ESTEC - European Space Agency
: P.O. Box 299 Internet: Giuseppe.Vacanti@astro.estec.esa.nl
: 2200 AG, Noordwijk Phone : +31-71-654175
: The Netherlands FAX : +31-71-654690

--
+------------------------+---------------------------------- --+---------+
| James Tappin, | School of Physics & Space Research | O__ |
| sjt@star.sr.bham.ac.uk | University of Birmingham | -- \/` |
| "If all else fails--read the instructions!" | |
+----------------------------------------------------------- --+---------+
[Message index]
 
Read Message
Read Message
Previous Topic: thanks
Next Topic: Call_external under Solaris

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

Current Time: Fri Oct 10 06:05:49 PDT 2025

Total time taken to generate the page: 0.80095 seconds