Re: Displaying 2D arrays [message #44848] |
Wed, 27 July 2005 10:55  |
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 #44860 is a reply to message #44855] |
Tue, 26 July 2005 21:19   |
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   |
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   |
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/
|
|
|
|
|