[R] Problem with fontsize of pie-chart in postscript file

Uwe Ligges ligges at statistik.uni-dortmund.de
Wed Jan 8 15:44:05 CET 2003


Daniel Hoppe wrote:
> 
> Hi all,
> 
> I've a problem with the size of the labels of my pie-charts when I try to
> write them to a postscript file. I need to increase the default size, so I
> change cex (see below). On screen this works fine, but cex doesn't seem to
> affect the postscript-file. Any suggestions?
> 
> Thanks a lot,
> 
> Daniel
> 
> Copy/Past-example (will try to write to c:/temp!):
> 
> labels <- c("I", "H", "G", "K", "V")
> lineItems <- c(6252,943605,271207,517764,44108)
> orders <- c(2084,226894,49218,164056,15809)
> value <- c(1380425,87743481,35212459,76346384,10403599)
> count <- c(52,17571,261,53270,843)
> 
> col = gray(seq(0.2,.8,length=6))
> 
> oldpar <- par()
> par(cex=2)
> #postscript("c:/temp/1.eps", onefile = FALSE)
> pie(lineItems, labels=labels, col=col, density=15, angle = 15 + 10 * 1:6)
> #dev.off()
> 
> postscript("c:/temp/2.eps", onefile = FALSE)
> pie(orders, labels=labels, col=col, density=15, angle = 15 + 10 * 1:6)
> dev.off()
> 
> postscript("c:/temp/3.eps", onefile = FALSE)
> pie(value, labels=labels, col=col, density=15, angle = 15 + 10 * 1:6)
> dev.off()
> par(oldpar)
> 

You have to set par() for the current device, i.e. after you invoked:

 postscript("c:/temp/1.eps", onefile = FALSE)
 par(cex=2)
 pie(lineItems, labels=labels, col=col, density=15, angle = 15 + 10 *
1:6)
 dev.off()

Uwe Ligges




More information about the R-help mailing list