Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R pairs function - How to change the diagonal values font size?

Tags:

r

I have a pairs function in R which is plotting a graphic but the font size is bigger than I would like. Is there any way to reduce it?

Update:

My pairs function:

pairs(~erro_O3_s+erro_NO2_s+O3_ref+NO2_ref, data=person.data,
      upper.panel=panel.regression, lower.panel=panel.cor, 
      pch=20)

I can change the font size with cex but not the diagonals font size.

like image 338
Vítor Martins Avatar asked May 22 '15 23:05

Vítor Martins


People also ask

How do you change the text size in R plot?

How to change font size in r? To change the font size of text, use cex (character expansion ratio). The default value is 1. To reduce the text size, use a cex value of less than 1; to increase the text size, use a cex value greater than 1.

What does the pairs function do in R?

pairs() function in R language is used to return a plot matrix, consisting of scatter plots corresponding to each data frame.

How do you interpret pair plots in R?

The way to interpret this matrix is as follows: The variable names are displayed on the outer edges of the matrix. The boxes along the diagonals display the density plot for each variable. The boxes in the lower left corner display the scatterplot between each variable.


1 Answers

cex.labels changes the diagonal font size.

Using the functions from your previous question: try pairs(mtcars[1:3], upper.panel=panel.regression, lower.panel=panel.cor, cex.labels=1)

and pairs(mtcars[1:3], upper.panel=panel.regression, lower.panel=panel.cor, cex.labels=10)

like image 110
Vítor Martins Avatar answered Sep 30 '22 18:09

Vítor Martins