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

Home » Public Forums » archive » Re: Making a square plot
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: Making a square plot [message #11003] Mon, 23 February 1998 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Carsten Dominik (dominik@strw.LeidenUniv.nl) writes:

> Why do simple things turn out diffcult in IDL, sometimes?

Yes. And I have also noticed that difficult things sometimes turn
out to be trivial! It's a strange world. :-)

> I am trying to make a plot with a square plot window. It has to be
> square since it is a map and the map data is a square matrix.
>
> Here is what I did.
>
> [Mistaken assuptions clipped.]
>
> If I am not mistaken, it should give me a 10cm by 10cm plot. However,
> I get 9.5x10.8 or something along those lines. Sure I can fiddle with
> xsize and ysize until it fits, but there should be a better way.
> Which? What am I doing wrong?

The basic thing you are doing wrong is allowing IDL to
position the axes of the plot using it's rules for plot
margins, which are based on character size. Far better
in this case to position the axes yourself with the POSITION
keyword. For example, your code would give you a square plot
just by making your contour command like this:

contour,a,levels=x,/follow,min_value=-19,$
c_charsize=1.5,c_charthick=3, $
position=[0.2, 0.2, 0.8, 0.8]

There are a number of articles in the 2D Graphics Tips
section of my web page about this, along with programs
(e.g., ASPECT) that can be used to give you a plot of
any aspect ratio in any kind of window, whether display
or PostScript. Information like this is also covered
extensively in my IDL Programming Techniques book.

Cheers,

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Structure question
Next Topic: Procedure shade_surface

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

Current Time: Wed Oct 08 19:52:32 PDT 2025

Total time taken to generate the page: 0.00521 seconds