[R] (no subject)

William Dunlap wdunlap at tibco.com
Fri Nov 30 23:26:39 CET 2012


Try subplot() from the TeachingDemos package.  E.g.,

  > plot(c(1,2,3), c(1,3,2), xlim=c(0,5), ylim=c(0,10))
  > subplot(pie(1:5), x=4, y=6)
  > abline(h=6, v=4)
  > subplot(pie(1:5), x=1, y=8, size=c(0.5, 0.5))

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf
> Of bibek sharma
> Sent: Friday, November 30, 2012 2:07 PM
> To: R help
> Subject: [R] (no subject)
> 
> Hello R usuer,
> 
> The code given below superimposes a pie diagram on another plot
> containing some points. However, I would like to center the pie
> diagram on the xy location on the plot, but not on the center. is
> there any way to re-center pic diagram.
> Any suggestion or better alternative are highly appreciated.
> Thank you in advance for your help.
> 
> Regards,
> Bibke
> 
> library(visualFields)
> library(car)
> a<-saplocmap$p24d2
> ordinate<-data.frame(a$xod,a$yod)
> plot( a$xod,a$yod, xlim=c(-30,30),
> ylim=c(-30,30),xlab="",ylab="",type="p", data=ordinate)
> abline(v=0,h=0)
> par(new=TRUE)
> 
> # Define cars vector with 8 values
> cars <- c(1,1,1,1,1,1,1,1)
> 
> # Define colors in each sector
> 
> color1 <- c("grey80","grey80","grey80","grey80","gray80","grey30","grey20","gray10"
> ) ## gray10=<0.0001, gray20<0.001, gray30<0.01, gray40=<0.05, gray
> 80=>0.05
> # Putting sector levels
> car_labels <- c(1,2,3,4,5,6,7,8)
> car_labels <- paste(car_labels,sep="")
> 
> # Create a pie chart with defined heading and custom colors
> # and labels
> 
> pie(cars, main="Sectors", col=color1, labels=" ",
> radius=0.05,border=NA, cex=0.8)
> 
> ______________________________________________
> R-help at r-project.org 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.




More information about the R-help mailing list