Square pixels in surface/lego plots [message #8407] |
Fri, 07 March 1997 00:00  |
bmac
Messages: 2 Registered: January 1996
|
Junior Member |
|
|
Let us say I have a rectangular array,
SAO56102=fltarr(60,30)
that I wish to make a lego-style surface plot of.
What's the simplest way to make sure the pixels come out reasonably
square? If you just do
surface,SAO56102,/lego
in a default-sized window/plot region the pixels are elongated and
rectangular and look terrible. surface seems to elongate the image independently
in each direction to fill the window.
The only options I've been able to come up with are
(a) By trial-and-error, change the size of the WINDOW or the
plotting region in postscript output until the image looks reasonable
(and then have to find a different size if I change, for example, the
viewing angle, or add axis labels, or for each new array...)
(b) Pad the array to be square and use a squarish window
(c) Use the yrange to make the axis of the graph square -
surface,SAO56102,/lego,yrange=[-15,45],ystyle=1
Any easier approaches?
Bruce
|
|
|
|
|
Re: Square pixels in surface/lego plots [message #8602 is a reply to message #8407] |
Wed, 26 March 1997 00:00  |
paulcs
Messages: 6 Registered: March 1997
|
Junior Member |
|
|
Bruce,
Have you tried using the Create_view/center_view routine?
IDL: create_view
WAVE: center_view
Bruce Macintosh <bmac@igpp.llnl.gov> writes:
> David Fanning wrote:
>>
>> Bruce Macintosh writes:
>>
>>> Let us say I have a rectangular array that I wish to make a
>>> lego-style surface plot of.
>>>
>>> What's the simplest way to make sure the pixels come out reasonably
>>> square?
>>
>> Download the program ASPECT from my web page and then make
>> a plot with a square aspect ratio, like this:
>>
>> SURFACE, Dist(60,30), /Lego, Position=Aspect(1.0)
>>
>> David
>>
> This turns out not to quite work. David's program does
> calculate (nicely) the plot size to deal with funny-shaped windows,
> but doesn't deal with oddly-shaped arrays going into surface.
> For example,
> figt=dist(60,10)
> window,0,xs=500,ys=500
> surface,figt,/lego,pos=aspect(1.0)
> certainly doesn't produce square lego pixels.
> Any alternative suggestions? This is vexing...If IDL 5 has a
> /iso keyword I'd even be willing to start installing the beta.
> (Please email as well as post replies - my newsfeed is unreliable.)
> Bruce Macintosh
> bmac@igpp.llnl.gov
--
Paul C. Sorenson
paulcs@netcom.com
|
|
|
Re: Square pixels in surface/lego plots [message #8622 is a reply to message #8407] |
Mon, 24 March 1997 00:00  |
Bruce Macintosh
Messages: 5 Registered: March 1997
|
Junior Member |
|
|
David Fanning wrote:
>
> Bruce Macintosh writes:
>
>> Let us say I have a rectangular array that I wish to make a
>> lego-style surface plot of.
>>
>> What's the simplest way to make sure the pixels come out reasonably
>> square?
>
> Download the program ASPECT from my web page and then make
> a plot with a square aspect ratio, like this:
>
> SURFACE, Dist(60,30), /Lego, Position=Aspect(1.0)
>
> David
>
This turns out not to quite work. David's program does
calculate (nicely) the plot size to deal with funny-shaped windows,
but doesn't deal with oddly-shaped arrays going into surface.
For example,
figt=dist(60,10)
window,0,xs=500,ys=500
surface,figt,/lego,pos=aspect(1.0)
certainly doesn't produce square lego pixels.
Any alternative suggestions? This is vexing...If IDL 5 has a
/iso keyword I'd even be willing to start installing the beta.
(Please email as well as post replies - my newsfeed is unreliable.)
Bruce Macintosh
bmac@igpp.llnl.gov
|
|
|