[R] Main title in a multiple display of graphs

Marcos Prunello marcospru at yahoo.com.ar
Thu Mar 10 22:37:52 CET 2011


Hello!

I want to display four xyplots in the same window (sorry if I don't use the propers words, but my English is rude)

I know that if I use plot(y~x) then

	x=(1:100)
	y=(1:100)
	par(mfrow=c(2,2))
	plot(y~x)
	plot(y~x)
	plot(y~x)
	plot(y~x)

would give what I want, but this is not the case because I need the functions of xyplot.

So I did the following:

	plot.new()
	title(main="Tasas de Mortalidad por 100.000 habitantes",outer=TRUE)
	print(xyplot(y~x), position=c(0,0.5,0.5,1), more=T)
	print(xyplot(y~x), position=c(0.5,0.5,1,1), more=T)
	print(xyplot(y~x), position=c(0,0,0.5,0.5), more=T)
	print(xyplot(y~x), position=c(0.5,0,1,0.5), more=T)

In the output the title is not complete, a part of the letters only is seen.
I searched how to solve this problem but nothing worked.

I read about "figure margins", proved with different things like oma, omi, mar, mai,layout, par, mfcol, mfrow,mtext,title...

I hope you can guide me!

Thanks a lot!

Marcos (Argentina)






More information about the R-help mailing list