
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Write Plot Title in Multiple Lines Using Plot Function in R
Mostly, the main title of a plot is short but we might have a long line to write for the main title of the plot. For example, a short version might be “Scatterplot” and a longer version might be “Scatterplot between X and Y”. Therefore, in plot function of R we can use line breaks for the main title as "Scatterplot
between
X and Y".
Example
set.seed(123) x <-rnorm(10) y <-rnorm(10,2.5)
Creating a simple scatterplot between x and y with main title −
plot(x,y,main="Scatterplot between X and Y")
Output
Creating a simple scatterplot between x and y with main title in multiple lines −
Output
plot(x,y,main="Scatterplot
between
X and Y")
Output
Advertisements