s-news
[Top] [All Lists]

Re: plot area

To: S-news community <s-news@lists.biostat.wustl.edu>
Subject: Re: plot area
From: "Meador, Doug" <Doug.Meador@ngwi.com>
Date: Thu, 31 Jul 2003 10:03:41 -0400
I tried to do the same thing but had no luck, so I wrote this function. I hope it serves your needs.
 
Doug
 
 
# Draws an area graph (like Excel's)
# area.col is the color of the shaded area.
areaplot <- function(x,y,area.col=1,...)
{
     x.rng <- range(x)
     y.rng <- range(y)
     plot(x = x, y = y, xlim=x.rng, ylim=y.rng, ...)
     if(class(x)=="timeDate")
     {
          polygon(timeDate(c(as.character(x), rev(as.character(x)))), c(y, rep(min(y), length(x))), col=area.col)
     }
         else
     {
          polygon(c(x, rev(x)), c(y, rep(min(y.rng), length(x))), col=area.col)
     }
}
-----Original Message-----
From: Bruno Cutayar [mailto:bcutayar@lfdj.com]
Sent: Thursday, July 31, 2003 8:56 AM
To: S-news community
Subject: [S] plot area

Hi all,
does someone know an equivalent for the guiPlot function :
guiPlot ( PlotType = "Area", DataSet = "data", Columns = "var1,var2,var3", GraphSheet = "GSD1", AxisType = "Linear") ?

i would like using regular plot function instead.

thank you,
Bruno



The information contained in or attached to this email is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are not authorized to and must not disclose, copy, distribute, or retain this message or any part of it. It may contain information, which is confidential and/or covered by legal professional or other privilege (or other rules or laws with similar effect in jurisdictions outside Canada).


The views expressed in this email are not necessarily the views of Centrica Canada Limited, Centrica US Holdings Inc. or their affiliates, and the said companies, their directors, officers or employees make no representation or accept any liability for its accuracy or completeness unless expressly stated to the contrary.

<Prev in Thread] Current Thread [Next in Thread>