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

Home » Public Forums » archive » Re: Filled area curve
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Filled area curve [message #85670] Mon, 26 August 2013 05:42 Go to previous message
Yngvar Larsen is currently offline  Yngvar Larsen
Messages: 134
Registered: January 2010
Senior Member
On Monday, 26 August 2013 14:15:40 UTC+2, Rob Dimeo wrote:
> Hi,
>
> A quick search on this NG came up fruitless but I'm hoping that someone has done this type of plot before.
>
> David has a very nice example of a curve with part of the area under it filled with a solid color: http://www.idlcoyote.com/gallery/filled_area_plot.png
>
> I would like to extend this so that the area is actually a sequence of colors, the value of which is tied to the independent variable. I intend to plot the magnitude of a complex function, |z(x)|, (as a function of some independent variable, x) as the "curve" and encode the phase angle (again, as a function of x) as a filled (generally multiple-) color area below the curve.
>
>
>
> So the main difference from the plot shown in the link above would be that the solid color that fills the area under the curve would instead be a gradient of colors that transition from one x-value to another, depending on the value of x and the color table used.

Something like this could be a starting point for you:

x = dindgen(360)/359
phase = x^2*4*!dpi
mag = abs(sin(2*!dpi*x))
z = mag*exp(complex(0,1)*phase)

col=bytscl(atan(z, /phase))

device, get_decomposed=decomp_flag

device, decomposed=1
plot, x, mag, /nodata
loadct, 33
device, decomposed=0
for ii=0, n_elements(x)-2 do polyfill, x[[ii, ii+1, ii+1, ii]], [0,0,mag[ii+1], mag[ii]], color=col[ii]
device, decomposed=1
oplot, x, mag, thick=2

device, decomposed=decomp_flag

--
Yngvar
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: generating sequences
Next Topic: Question about CURVEFIT function

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

Current Time: Wed Oct 08 18:31:42 PDT 2025

Total time taken to generate the page: 0.00462 seconds