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

Home » Public Forums » archive » Square pixels in surface/lego 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
Square pixels in surface/lego plots [message #8407] Fri, 07 March 1997 00:00 Go to next message
bmac is currently offline  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 [message #8465 is a reply to message #8407] Fri, 14 March 1997 00:00 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Hayet Merouani writes:

> I have an image of mammogram and I want to divide this image into squares.
> Anyone knew how to do that?

Use array subscripts.

squareSubImage = image(50:149, 75:224)

Cheers!

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
2642 Bradbury Court, Fort Collins, CO 80521
Phone: 970-221-0438 Fax: 970-221-4762
E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
-----------------------------------------------------------
Re: Square pixels in surface/lego plots [message #8497 is a reply to message #8407] Sun, 09 March 1997 00:00 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
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

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
2642 Bradbury Court, Fort Collins, CO 80521
Phone: 970-221-0438 Fax: 970-221-4762
E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
-----------------------------------------------------------
Re: Square pixels in surface/lego plots [message #8602 is a reply to message #8407] Wed, 26 March 1997 00:00 Go to previous message
paulcs is currently offline  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 Go to previous message
Bruce Macintosh is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Software for importing EPS files into MS Office applications
Next Topic: Linked List

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

Current Time: Wed Oct 08 19:16:51 PDT 2025

Total time taken to generate the page: 0.00635 seconds