Data visualization in R: Titles for window and axis

You can define a title and a sub title for the plot and label the axis. Set the according parameters: main, sub, xlab and ylab. The following example shows an according plot.

plot(1,2, main = ‚Title‘, sub = ’sub title‘ , xlab = ‚X axis‘, ylab = ‚Y axis‘)

R08_a

 
The size of the text can be modified using the parameters cex.main, cex.sub and cex.axis. Those parameters define a scaling factor, the character expansion factor. A value smaller one will decrease the size of the text and a value larger one will increase it.

plot(1,2, main = ‚Title‘, sub = ’sub title‘ , xlab = ‚X axis‘, ylab = ‚Y axis‘, cex.main = 2, cex.sub = 1.5, cex.axis = 0.75)

R08_b

Werbung
Dieser Beitrag wurde unter R veröffentlicht. Setze ein Lesezeichen auf den Permalink.

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit deinem WordPress.com-Konto. Abmelden /  Ändern )

Facebook-Foto

Du kommentierst mit deinem Facebook-Konto. Abmelden /  Ändern )

Verbinde mit %s