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

Home » Public Forums » archive » Re: Displaying 2D arrays
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: Displaying 2D arrays [message #44848] Wed, 27 July 2005 10:55 Go to next message
liamgumley is currently offline  liamgumley
Messages: 74
Registered: June 2005
Member
Here's one way:

image = reform(bindgen(40) mod 2, 5, 8)
loadct, 0
tvlct, 0, 255, 0, 0
imdisp, image, /axis, xticklen=1, yticklen=1, bottom=1, color=0

IMDISP is available from

http://www.gumley.com/PIP/Free_Software.html

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
Re: Displaying 2D arrays [message #44851 is a reply to message #44848] Wed, 27 July 2005 08:49 Go to previous messageGo to next message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <k-bowman-227FC4.09583827072005@news.tamu.edu>,
Kenneth Bowman <k-bowman@null.tamu.edu> wrote:

> In article <MPG.1d50b50bdc529fa7989a29@news.frii.com>,
> David Fanning <davidf@dfanning.com> wrote:
>
>> Kenneth P. Bowman writes:
>>
>>> TV, BYTSCL(array)
>>
>> Well, no grid lines there. :-)
>
> Well, he didn't ask for grid lines. ;-)
>
> Ken

Ah, details, details, ...

Ken
Re: Displaying 2D arrays [message #44852 is a reply to message #44851] Wed, 27 July 2005 08:30 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Kenneth Bowman writes:

> In article <MPG.1d50b50bdc529fa7989a29@news.frii.com>,
> David Fanning <davidf@dfanning.com> wrote:
>
>> Kenneth P. Bowman writes:
>>
>>> TV, BYTSCL(array)
>>
>> Well, no grid lines there. :-)
>
> Well, he didn't ask for grid lines. ;-)

Are you certain?

> 1? It should look exactly like an 'image' of a 2D array, but also
> should have axes and gridlines.
> Is that possible?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Displaying 2D arrays [message #44855 is a reply to message #44852] Wed, 27 July 2005 07:58 Go to previous messageGo to next message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <MPG.1d50b50bdc529fa7989a29@news.frii.com>,
David Fanning <davidf@dfanning.com> wrote:

> Kenneth P. Bowman writes:
>
>> TV, BYTSCL(array)
>
> Well, no grid lines there. :-)

Well, he didn't ask for grid lines. ;-)

Ken
Re: Displaying 2D arrays [message #44860 is a reply to message #44855] Tue, 26 July 2005 21:19 Go to previous messageGo to next message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
David Fanning wrote:
>> How about something like this:
>>
>> s = Size(array, /Dimensions)
>> pos=[0.1, 0.1, 0.9, 0.9]
>> TVImage, Bytscl(array), Position=pos, /Keep_Aspect
>> Plot, [0, s[0]], [0,s[1]], /NoData, /NoErase, $
>> Position=pos, XTicklen=1, YTicklen=1
>
>
> Whoops! Better get those STYLE keywords in there, too. :-)
>
> Plot, [0, s[0]], [0,s[1]], /NoData, /NoErase, $
> Position=pos, XTicklen=1, YTicklen=1, XStyle=1, YStyle=1


Or, if you're that way inclined, IIMAGE. Not that I've ever used it
myself...

--
Mark Hadfield "Kei puwaha te tai nei, Hoea tahi tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
Re: Displaying 2D arrays [message #44861 is a reply to message #44860] Tue, 26 July 2005 21:05 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> How about something like this:
>
> s = Size(array, /Dimensions)
> pos=[0.1, 0.1, 0.9, 0.9]
> TVImage, Bytscl(array), Position=pos, /Keep_Aspect
> Plot, [0, s[0]], [0,s[1]], /NoData, /NoErase, $
> Position=pos, XTicklen=1, YTicklen=1

Whoops! Better get those STYLE keywords in there, too. :-)

Plot, [0, s[0]], [0,s[1]], /NoData, /NoErase, $
Position=pos, XTicklen=1, YTicklen=1, XStyle=1, YStyle=1

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Displaying 2D arrays [message #44862 is a reply to message #44861] Tue, 26 July 2005 21:01 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Kenneth P. Bowman writes:

> TV, BYTSCL(array)

Well, no grid lines there. :-)

How about something like this:

s = Size(array, /Dimensions)
pos=[0.1, 0.1, 0.9, 0.9]
TVImage, Bytscl(array), Position=pos, /Keep_Aspect
Plot, [0, s[0]], [0,s[1]], /NoData, /NoErase, $
Position=pos, XTicklen=1, YTicklen=1

TVImage can be found here:

http://www.dfanning.com/programs/tvimage.pro

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Displaying 2D arrays [message #44863 is a reply to message #44862] Tue, 26 July 2005 20:19 Go to previous messageGo to next message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <1122418101.776129.60180@g49g2000cwa.googlegroups.com>,
"ntigris@gmail.com" <ntigris@gmail.com> wrote:

> Hello,
>
> I have a 2D array filled with 0's and 1's. How do i display it so that
> there is simply a dot for each
> 1? It should look exactly like an 'image' of a 2D array, but also
> should have axes and gridlines.
> Is that possible?
>
> I tried image_cont, but then I don't know how to get rid of the
> contour...
>
> Thanks a lot!

TV, BYTSCL(array)

??

Ken Bowman
Re: Displaying 2D arrays [message #44997 is a reply to message #44848] Wed, 27 July 2005 10:59 Go to previous message
ntigris@gmail.com is currently offline  ntigris@gmail.com
Messages: 6
Registered: July 2005
Junior Member
Thanks a lot! :)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Displaying 2D arrays
Next Topic: Re: Read _ tiff with Sub_Rect Keyword

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

Current Time: Wed Oct 08 19:42:58 PDT 2025

Total time taken to generate the page: 0.00431 seconds