[R] how to fill between 2 stair plots

Petr Klasterecky klaster at karlin.mff.cuni.cz
Mon Feb 26 09:49:42 CET 2007


Williams Scott napsal(a):
> Hi all,
> 
> I want to create a simple plot with 2 type='s' lines on it:
> 
> plot(a, b, type='s')
> lines(x, y, type='s') 
> 
> I wish to then fill the area between the curves with a colour to
> accentuate the differences eg col=gray(0.95). I cant seem to come up
> with a simple method for this. Any pointers in the right direction much
> appreciated.
> 
> Cheers
> 
> Scott
> _____________________________
> 
> Dr. Scott Williams
> 
> MBBS BScMed FRANZCR
> 
> Peter MacCallum Cancer Centre
> 
> Melbourne, Australia
> 
> scott.williams at petermac.org
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
?polygon might be useful. See also demo(graphics)
Petr
-- 
Petr Klasterecky
Dept. of Probability and Statistics
Charles University in Prague
Czech Republic



More information about the R-help mailing list