[R] Graphing question (multiple line graphs arranged spatially)

Jim Lemon jim at bitwrit.com.au
Wed Mar 12 12:08:38 CET 2008


stephen sefick wrote:
> station month   bas
> 190     5       0.000
> 190     7       1.563
> 190     10      0.000
> 190     11      0.000
> 202     4       18.750
> 202     5       18.750
> 202     7       6.250
> 202     10      4.800
> 202     11      3.125
> 198     4       18.750
> 198     5       31.250
> 198     7       3.125
> 198     10      3.200
> 198     11      12.500
> 205     4       0.000
> 205     5       0.000
> 205     7       0.000
> 205     10      0.000
> 205     11      0.000
> 
> c<-read.table("foo.txt", header=TRUE)
> x<-subset(c, station=="190")
> plot(x$bas~x$month, type="b")
> y<-subset(c, station=="198")
> plot(y$bas~y$month, type="b")
> z<-subset(c, station=="202")
> plot(z$bas~z$month, type="b")
> zz<-subset(c, station=="205")
> plot(zz$bas~zz$month, type="b")
> 
> I would like to put all of the all of these individual line graphs
> into one 3d graph organized by descending station (205-190).  Does
> anyone know how to do this?

Hi Stephen,

One way may be with brkdn.plot (slightly modified and this isn't 3D):

library(plotrix)
# get the modification for one observation per point
# this will be in the next version of brkdn.plot
source("brkdn.plot.R")
brkdn.plot("bas","station","month",ss.df,xaxlab=c(4,5,7,10,11),
  dispbar=FALSE,md=NA,pch=1:5,lty=1:5,xlab="Month")
legend(8,25,unique(ss.df$station),pch=1:5,lty=1:5)

Thanks for this - I hadn't thought about using this function with one 
datum per point. The modified function follows.

Jim
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: brkdn.plot.R
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20080312/26355870/attachment.pl 


More information about the R-help mailing list