filling area for an XY plot [message #90039] |
Mon, 19 January 2015 11:52  |
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 #90041 is a reply to message #90039] |
Mon, 19 January 2015 18:51  |
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
|
|
|