[R] switch of cex adjustment with mfrow?

S Ellison S.Ellison at LGCGroup.com
Wed Aug 2 18:14:45 CEST 2017


Checking ?par, 
" In a layout with exactly two rows and columns the base value
   of '"cex"' is reduced by a factor of 0.83: if there are three
   or more of either rows or columns, the reduction factor is
   0.66."

You should be able to simply set cex to 1/0.83 for a 2x2 layout and by 1/0.66 for larger layouts, in a nw 'par' call after setting mfrow or mfcol.
More generally, use the cex value set by mfrow/col:

par(mfrow=c(2,2))
par(cex=1/par("cex"))

plot(1:10)
	#Normal size symbols, labels etc.


> -----Original Message-----
> From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Jannis via
> R-help
> Sent: 02 August 2017 13:29
> To: r-help at r-project.org
> Subject: [R] switch of cex adjustment with mfrow?
> 
> Dear list members,
> 
> 
> i am trying to create multiple figures with identical layout (i.e. font sizes etc.)
> for a publication created with Latex. To do so (i.e. to get identical font sizes) I
> save all plots as a pdf with widths and heights as they would later appear in
> the paper (to prevent scaling etc.). My problem now is that I create several
> multipanel plots with par(mfrow=c(...)) which sometimes changes the cex
> value. Is there any way (other than using layout() etc which would mean a lot
> of recoding) to prevent this and have identical point and font sizes and line
> widths etc throughout all plots? I tried to increase the cex value so that after
> the reduction by mfrow it is again 1 but I am not sure whether this prevents
> all resizing and was hoping for an easier way to achive this?
> Any ideas?
> CheersJannis
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.


*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-help mailing list