How can the font size of text and axes on R plots be changed?

197    Asked by DianeCarr in Data Science , Asked on Jul 31, 2023

What is the proper way to increase the font size of text in the labels, titles, and other areas of the plot?


Answered by Diane Carr

The plot method in the R coding language is meant to plot a set of points in the graph and see them deploying curves and scatter that is followed.


The default value is 1. If you wish to decrease the text size, you can utilize a cex value of less than 1; To raise the text size, you can deploy a cex value higher than 1.

> x < - seq(0.5, 1.5, 0.25)
> y < - rep(1, length(x))
> plot(x, y, main=”effect of cex on text size”)
> text(x, y+0.1, labels=x, cex=x)

The Data Science Certification Training offered at JanBask Training provides courses similar to offline sessions, helping students attain a broad idea on the basic and advanced concepts related to Data Science. The students also get to know the ways to manage structured and unstructured data applying the intelligence to figure out substantial conclusions. JanBask Training makes you industry-ready to face the job market scenario, examining the provided data and creating proper insights from them.


Your Answer

Interviews

Parent Categories