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

Home » Public Forums » archive » filling area for an XY plot
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
filling area for an XY plot [message #90039] Mon, 19 January 2015 11:52 Go to next message
mkmvarma is currently offline  mkmvarma
Messages: 24
Registered: November 2007
Junior Member
I would like to fill an area for an XY plot. I have altitude on Y axis and percentage difference on X axis. I have three lines plotted, the center line being the mean value and the other two lines are +/_ 1 standard deviation. I would like to plot the standard deviation from mean as a shaded area. I tried to use polyfill but was no luck. Any help will be appreciated.
Thanks,
Mahesh
Re: filling area for an XY plot [message #90040 is a reply to message #90039] Mon, 19 January 2015 17:01 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
mkmvarma@gmail.com writes:

> I would like to fill an area for an XY plot. I have altitude on Y axis and percentage difference on X axis. I have three lines plotted, the center line being the mean value and the other two lines are +/_ 1 standard deviation. I would like to plot the standard deviation from mean as a shaded area. I tried to use polyfill but was no luck. Any help will be appreciated.

See the code for the Error Estimate Plot in the Coyote Gallery:

http://www.idlcoyote.com/gallery/index.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: filling area for an XY plot [message #90041 is a reply to message #90039] Mon, 19 January 2015 18:51 Go to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Monday, January 19, 2015 at 12:52:28 PM UTC-7, mkmv...@gmail.com wrote:
> I would like to fill an area for an XY plot. I have altitude on Y axis and percentage difference on X axis. I have three lines plotted, the center line being the mean value and the other two lines are +/_ 1 standard deviation. I would like to plot the standard deviation from mean as a shaded area. I tried to use polyfill but was no luck. Any help will be appreciated.
> Thanks,
> Mahesh

Example from the POLYGON function:

data = RANDOMU(s,81)*15-5
upper = data + RANDOMU(s,81)*2 + 6
bottom = data - RANDOMU(s,81)*3 - 7
year = INDGEN(81) + 1930
key = 1942

p = PLOT(year, data, XRANGE=[1930,2010], YRANGE=[-15,20], $
YTITLE='Soil Heat Accumulation [MJ m$^{-2}$]', THICK=2)
poly = POLYGON([year,reverse(year)], [upper,reverse(bottom)], $
[REPLICATE(-0.01,162)], /DATA, /FILL_BACKGROUND, $
FILL_COLOR="light steel blue")


Cheers,
Chris
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Colors for the Color Blind
Next Topic: finite function

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

Current Time: Wed Oct 08 07:14:27 PDT 2025

Total time taken to generate the page: 0.00418 seconds