block fill image

This is a discussion on block fill image within the Idl-pvwave forums in Programming Languages category; Dear all, I would like to make an image, presenting cluster classes on the x- axes, and different variables on the Y-axes. Each combination (Xi,Yi) should be represented by a block, whereby its color fill should represent a standard deviation, and with the mean written in the box as text. If have no idea how I could construct something like that? Could anybody help me out with this? Thank you! Best Regards, Matthias...

Go Back   Application Development Forum > Programming Languages > Idl-pvwave

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-05-2008, 07:58 AM
maffie
Guest
 
Default block fill image

Dear all,

I would like to make an image, presenting cluster classes on the x-
axes, and different variables on the Y-axes. Each combination (Xi,Yi)
should be represented by a block, whereby its color fill should
represent a standard deviation, and with the mean written in the box
as text.

If have no idea how I could construct something like that? Could
anybody help me out with this?

Thank you!
Best Regards,
Matthias
Reply With Quote
  #2  
Old 09-05-2008, 09:50 AM
ben.bighair
Guest
 
Default Re: block fill image

On Sep 5, 7:58 am, maffie <matthias.demuz...@geo.kuleuven.be> wrote:
> Dear all,
>
> I would like to make an image, presenting cluster classes on the x-
> axes, and different variables on the Y-axes. Each combination (Xi,Yi)
> should be represented by a block, whereby its color fill should
> represent a standard deviation, and with the mean written in the box
> as text.
>


Hi,

I think you could simply create the image and populate each pixel with
the standard deviation. Then the trick is to use an image display
routine that will use nearest neighbor interpolation - try David
Fanning's TVSCALE or Liam Gumley's IMDISP for example. You'll want to
carefully control the color scheme for which each of these gives you
plenty of options. The subsequent annotations can be done using
XYOUTS like this..

dy = (y[1]-y[0])/2.
for i = 0L, nx-1 do begin
for j = 0L, ny-1 do begin
XYOUTS, x[i], y[j] + dy, stddev[i,j], ALIGN = 0.5, ....
endfor ; j loop
endfor ; i loop

You may want to add an offset in the Y direction for the image - that
is what the dy is about.


Cheers,
Ben
Reply With Quote
  #3  
Old 09-05-2008, 10:29 AM
Bennett
Guest
 
Default Re: block fill image

On Sep 5, 9:50*am, "ben.bighair" <ben.bigh...@gmail.com> wrote:
> On Sep 5, 7:58 am, maffie <matthias.demuz...@geo.kuleuven.be> wrote:
>
> > Dear all,

>
> > I would like to make an image, presenting cluster classes on the x-
> > axes, and different variables on the Y-axes. Each combination (Xi,Yi)
> > should be represented by a block, whereby its color fill should
> > represent a standard deviation, and with the mean written in the box
> > as text.

>
> Hi,
>
> I think you could simply create the image and populate each pixel with
> the standard deviation. *Then the trick is to use an image display
> routine that will use nearest neighbor interpolation - try David
> Fanning's TVSCALE or Liam Gumley's IMDISP for example. *You'll want to
> carefully control the color scheme for which each of these gives you
> plenty of options. *The subsequent annotations can be done using
> XYOUTS like this..
>
> dy = (y[1]-y[0])/2.
> for i = 0L, nx-1 do begin
> * for j = 0L, ny-1 do begin
> * * XYOUTS, x[i], y[j] + dy, stddev[i,j], ALIGN = 0.5, ....
> * endfor ; j loop
> endfor ; i loop
>
> You may want to add an offset in the Y direction for the image - that
> is what the dy is about.
>
> Cheers,
> Ben


polyfill is another IDL procedure that you may be interested in if you
are wanting to make blocks of different colors on the plot
Reply With Quote
  #4  
Old 09-06-2008, 06:39 AM
maffie
Guest
 
Default Re: block fill image

Thank you all for the comments.

Now, I have tried to TVscale of David, but I always get an error
message "that the procedure can not be found", although it is called
from a library IDL knows. When looking in to the TVSCALE script, I get
an error message in the following:
; Set up common block parameters, but only if device supports windows.
; Only if the QUIET keyword is not set.
IF ~Keyword_Set(quiet) THEN BEGIN
IF (!D.FLAGS AND 256) NE 0 THEN BEGIN
_tvimage_xsize = imgXsize
_tvimage_ysize = imgYsize
_tvimage_winID = !D.Window
_tvimage_winxsize = !D.X_Size
_tvimage_winysize = !D.Y_Size
_tvimage_position = position
_tvimage_current = 1
ENDIF
ENDIF

Does anybody has an idea what I am doing wrong here?

Cheers,
Matthias
Reply With Quote
  #5  
Old 09-07-2008, 10:18 AM
ben.bighair
Guest
 
Default Re: block fill image

On Sep 6, 6:39 am, maffie <matthias.demuz...@geo.kuleuven.be> wrote:
> Thank you all for the comments.
>
> Now, I have tried to TVscale of David, but I always get an error
> message "that the procedure can not be found", although it is called
> from a library IDL knows. When looking in to the TVSCALE script, I get
> an error message in the following:
> ; Set up common block parameters, but only if device supports windows.
> ; Only if the QUIET keyword is not set.
> IF ~Keyword_Set(quiet) THEN BEGIN
> IF (!D.FLAGS AND 256) NE 0 THEN BEGIN
> _tvimage_xsize = imgXsize
> _tvimage_ysize = imgYsize
> _tvimage_winID = !D.Window
> _tvimage_winxsize = !D.X_Size
> _tvimage_winysize = !D.Y_Size
> _tvimage_position = position
> _tvimage_current = 1
> ENDIF
> ENDIF
>
> Does anybody has an idea what I am doing wrong here?


It is a little confusing that you get the ""that the procedure can not
be found" AND you can track down error within that code. Something is
a little fishy with that. In any event, I have a couple of
suggestions:

- download a fresh copy of David's Coyote library and restart or do
a .FULL_RESET
- make sure that it really is on your search path (examine !PATH and
try FILE_WHICH("tvscale.pro"))

Ben




Reply With Quote
  #6  
Old 09-30-2008, 11:04 AM
kfish
Guest
 
Default Re: block fill image

On Sep 5, 10:29*am, Bennett <juggernau...@gmail.com> wrote:
> On Sep 5, 9:50*am, "ben.bighair" <ben.bigh...@gmail.com> wrote:
>
>
>
>
>
> > On Sep 5, 7:58 am, maffie <matthias.demuz...@geo.kuleuven.be> wrote:

>
> > > Dear all,

>
> > > I would like to make an image, presenting cluster classes on the x-
> > > axes, and different variables on the Y-axes. Each combination (Xi,Yi)
> > > should be represented by ablock, whereby its color fill should
> > > represent a standard deviation, and with the mean written in the box
> > > as text.

>
> > Hi,

>
> > I think you could simply create the image and populate each pixel with
> > the standard deviation. *Then the trick is to use an image display
> > routine that will use nearest neighbor interpolation - try David
> > Fanning's TVSCALE or Liam Gumley's IMDISP for example. *You'll want to
> > carefully control the color scheme for which each of these gives you
> > plenty of options. *The subsequent annotations can be done using
> > XYOUTS like this..

>
> > dy = (y[1]-y[0])/2.
> > for i = 0L, nx-1 do begin
> > * for j = 0L, ny-1 do begin
> > * * XYOUTS, x[i], y[j] + dy, stddev[i,j], ALIGN = 0.5, ....
> > * endfor ; j loop
> > endfor ; i loop

>
> > You may want to add an offset in the Y direction for the image - that
> > is what the dy is about.

>
> > Cheers,
> > Ben

>
> polyfill is another IDL procedure that you may be interested in if you
> are wanting to make blocks of different colors on theplot- Hide quoted text -
>
> - Show quoted text -


I'm just learning IDL and am having a heck of a time figuring out how
to make just a simple block plot. What I'd like to do, for example,
is plot temperature by depth on the x and y and have another variable,
fish growth, color coded in each temp-depth cell. I'm assuming I can
do this with polyfill or contour, but haven't been able to figure out
how. I'd appreciate any help I can get on this. Thanks!
Reply With Quote
  #7  
Old 09-30-2008, 12:08 PM
David Fanning
Guest
 
Default Re: block fill image

kfish writes:

> I'm just learning IDL and am having a heck of a time figuring out how
> to make just a simple block plot. What I'd like to do, for example,
> is plot temperature by depth on the x and y and have another variable,
> fish growth, color coded in each temp-depth cell. I'm assuming I can
> do this with polyfill or contour, but haven't been able to figure out
> how. I'd appreciate any help I can get on this.


I sympathize, because what you want to do, although
it seems simple, is actually quite complex using
IDL. You will probably have to build roll your own,
unfortunately.

I've done something very much like what you are going
to want to do, though, in the program HistoPlot. You
can read more about it here:

http://www.dfanning.com/graphics_tips/histoplot.html

I think if you look at the code (and I haven't looked at
it this morning) you will find it meticulously documented
(good luck!). Well, anyway, it is a place to start. :-)

Cheers,

David

--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 03:36 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.