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

Home » Public Forums » archive » Re: matrix plot similar to pcolor() in matlab?
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: matrix plot similar to pcolor() in matlab? [message #40747] Fri, 27 August 2004 12:20
Justin[3] is currently offline  Justin[3]
Messages: 8
Registered: November 2003
Junior Member
It's certainly not as versatile as pcolor, but I've written a routine for
plotting spectra which plots (rectangular) blocks of solid colour, each
block centred at x,y whose colours are determined by z, where x and y are
1-d arrays of co'ordinates and z is a 2d-array of values. If this is the
kind of thing you're interested in I'd be happy to share.

Justin


Josef Koller <news@koller.info> wrote in news:412e10ff$1_1@news3.es.net:

> Hi there,
> does anyone know how to plot a simple 2D matrix similar to the pcolor()
> command in matlab?
> Thanks for your help in advance. I've spend already hours on this but
> nothing comes close.
>
> josef
Re: matrix plot similar to pcolor() in matlab? [message #40771 is a reply to message #40747] Thu, 26 August 2004 10:00 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Josef Koller writes:

> does anyone know how to plot a simple 2D matrix similar to the pcolor()
> command in matlab?

No, I don't.

> Thanks for your help in advance. I've spend already hours on this but
> nothing comes close.

Hours, huh. Just reading about what pcolor() does,
I should think this would come reasonably close:

matrix = RandomU(-3L, 10, 10)
pos = [0.15,0.15, 0.9, 0.9]
LoadCT, 5
TVImage, BytScl(Congrid(matrix, 400, 400)), Position=pos
Plot, [0,10], [0,10], Position=pos, /NoErase, /NoData

You might have to download TVIMAGE:

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

If I wanted to *interpolate* the colors from the
neighbors, then I might have to think about the
problem for more than a couple of minutes. I'd
probably try something with an IDLgrSurface
and a texture map. :-)

http://www.dfanning.com/ographics_tips/imgtex.html

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: rate in xinteranimate
Next Topic: Beyond 7-bit ASCII

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

Current Time: Fri Oct 10 10:50:33 PDT 2025

Total time taken to generate the page: 0.87925 seconds