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

Home » Public Forums » archive » Re: Diplay 2D data
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: Diplay 2D data [message #57083] Tue, 04 December 2007 08:20
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
I fully agree with you on all counts. I wrote that imagesc because I
couldn't find a solution that worked for me and I needed axes.
imagesc can display just part of an image by inputing the 2-d data and
the x and y values, then using the xrange and yrange keywords. At
this moment it won't pad zeros to make a larger range but that is just
laziness but you might be able to change that.

One thought is to create some kind of object to contain the 2-d data
and the x and y values and manipulate the object though defined
methods to create a connection between the axes and the 2-d data.
Then it could be displayed using a modified imagsc, tvscl, tvim, or
anything else.


just a thought,

Brian

------------------------------------------------------------ --------------
Brian Larsen
Boston University
Center for Space Physics
Re: Diplay 2D data [message #57085 is a reply to message #57083] Tue, 04 December 2007 08:07 Go to previous message
Jeff N. is currently offline  Jeff N.
Messages: 120
Registered: April 2005
Senior Member
On Dec 4, 5:26 am, Lasse Clausen <la...@lbnc.de> wrote:
> Hi there,
>
> in one of the recent posts there was a link to Brian Larsen's homepage
> and in particular his imagesc.pro. This reminded me that I wanted to
> ask a question related to the matter of image display with axes:
>
> What's the best way to display 2D colour-coded data with axes and what-
> not? Or rather, what do people out there use?
>
> For a long time I used a routine called IMDISP which I downloaded
> somewhere. It seems to be the same approach as Brian's, getting a 2D
> array, using one of the TV commands to display it at a certain
> position and the overplotting axes. I am not happy with that approach
> because axes and image are completely unconnected, if I change the
> axes ranges then I (or the display routine) needs to chop of bits of
> the image array, otherwise the same image is displayed just with
> different axes. More importantly, both mentioned routines cannot pad
> zeros to the image such that the axis range is extended over the
> extends of the image. This is important for me because I am anal and I
> want my dynamic spectra plots to start at round times - but the data
> doesn't. And also, since the pixels have finite dimensions, I really
> also need to change the axes values to the exact position at the end
> of the pixel.
>
> This then led me to write my own routine which uses POLYFILL. So
> basically every pixel is drawn as a filled polygon with a certain
> colour. This allows me to easily (in my mind) change the ranges
> without having to fiddle with the data.
>
> However, not only is a FOR loop with POLYFILL slow but also a page of
> three dynamic spectra with 8000x128 points now easily makes a 40MB
> PostScript - not surprisingly, really.
>
> So to get back to the original question: How do other people display
> 2D data?
>
> Cheers
> Lasse Clausen

David's XImage program might be useful for you:
http://www.dfanning.com/documents/programs.html#XIMAGE

Also note that iImage displays images with axes if you want to go down
that road.
Re: Diplay 2D data [message #57089 is a reply to message #57085] Tue, 04 December 2007 06:43 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Dec 4, 4:26 am, Lasse Clausen <la...@lbnc.de> wrote:
> Hi there,
>
> in one of the recent posts there was a link to Brian Larsen's homepage
> and in particular his imagesc.pro. This reminded me that I wanted to
> ask a question related to the matter of image display with axes:
>
> What's the best way to display 2D colour-coded data with axes and what-
> not? Or rather, what do people out there use?
>
> For a long time I used a routine called IMDISP which I downloaded
> somewhere. It seems to be the same approach as Brian's, getting a 2D
> array, using one of the TV commands to display it at a certain
> position and the overplotting axes. I am not happy with that approach
> because axes and image are completely unconnected, if I change the
> axes ranges then I (or the display routine) needs to chop of bits of
> the image array, otherwise the same image is displayed just with
> different axes. More importantly, both mentioned routines cannot pad
> zeros to the image such that the axis range is extended over the
> extends of the image. This is important for me because I am anal and I
> want my dynamic spectra plots to start at round times - but the data
> doesn't. And also, since the pixels have finite dimensions, I really
> also need to change the axes values to the exact position at the end
> of the pixel.
>
> This then led me to write my own routine which uses POLYFILL. So
> basically every pixel is drawn as a filled polygon with a certain
> colour. This allows me to easily (in my mind) change the ranges
> without having to fiddle with the data.
>
> However, not only is a FOR loop with POLYFILL slow but also a page of
> three dynamic spectra with 8000x128 points now easily makes a 40MB
> PostScript - not surprisingly, really.
>
> So to get back to the original question: How do other people display
> 2D data?
>
> Cheers
> Lasse Clausen

I use tvim (http://www.astro.washington.edu/deutsch/idl/htmlhelp/
library28.html#TVIM) mostly out of habit, though. David has a nice tv/
tvscl replacement on his website, too http://www.dfanning.com/programs/tvimage.pro
. I don't think either of these handle the axes the way you want them
to, though. I always just extrac(t) the appropriate range and use
that.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Create iTool save file programmatically
Next Topic: Internationalization in IDL 7.0

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

Current Time: Sat Oct 11 01:38:15 PDT 2025

Total time taken to generate the page: 0.55975 seconds