Re: plot a square. [message #22117] |
Sat, 21 October 2000 00:00 |
Ben Tupper
Messages: 186 Registered: August 1999
|
Senior Member |
|
|
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hello,
<p>You might try the ISOTROPIC keyword to plot.
<p>From the online help.
<blockquote TYPE=CITE>
<pre>ISOTROPIC
Set this keyword to force the scaling of the X and Y axes to be equal.
Note - The X and Y axes will be scaled isotropically and then fit within</pre>
</blockquote>
<blockquote TYPE=CITE>
<pre>the rectangle defined by the POSITION keyword; one of the axes may be shortened.</pre>
</blockquote>
<blockquote TYPE=CITE>
<pre>See POSITION for more information.</pre>
</blockquote>
<p><br>Note that the window size is not adjusted, rather the axes are.
<p>Ben
<p>Peter Brooker wrote:
<blockquote TYPE=CITE>Assume that I have the following data
<br>x=[0,1,1,0]
<br>y=[0,0,1,1]
<p>this defines a square.
<p>plot,x,y
<p>results in a "non-square" plot.
<p>Is there an easy way to tell IDL to adjust the window size so that the
<br>square will plot as a square on my screen?
<p>thanks</blockquote>
--
<br>Ben Tupper
<br>248 Lower Round Pond Road
<br>POB 106
<br>Bristol, ME 04539
<p>Tel: (207) 563-1048
<br>Email: PemaquidRiver@tidewater.net
<br> </html>
|
|
|
Re: plot a square. [message #22120 is a reply to message #22117] |
Fri, 20 October 2000 00:00  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Peter Brooker <ra5589@email.sps.mot.com> writes:
> Assume that I have the following data
> x=[0,1,1,0]
> y=[0,0,1,1]
>
> this defines a square.
>
> plot,x,y
>
> results in a "non-square" plot.
>
> Is there an easy way to tell IDL to adjust the window size so that the
> square will plot as a square on my screen?
Did you mean:
window, win, 100, 100
Or, will this get you started?
plots, [0,100,100,0], [0,0,100,100], /device
The device keyword forces the operation to occur in pixel space.
Since your coordinate axes don't seem to matter to you, this is
probably the best option. Note you can get the display size in pixels
from the !D system variable, in case you need to scale accordingly.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: plot a square. [message #22121 is a reply to message #22120] |
Fri, 20 October 2000 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Peter Brooker (ra5589@email.sps.mot.com) writes:
> Assume that I have the following data
> x=[0,1,1,0]
> y=[0,0,1,1]
>
> this defines a square.
>
> plot,x,y
>
> results in a "non-square" plot.
>
> Is there an easy way to tell IDL to adjust the window size so that the
> square will plot as a square on my screen?
This works in any size window:
Plot, x, y, Position=Aspect(1.0)
You can find ASPECT.PRO on my web page:
http://www.dfanning.com/programs/aspect.pro
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|