- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to write the 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
- Related Articles
- How to put the plot title inside the plot using ggplot2 in R?
- How to change the position of the title of a plot which is created using plot function in R?
- How to write plot description outside plot in facetted plot using ggplot2 in R?
- Create multiple regression lines in a single plot using ggplot2 in R.
- How to change the title of a graph to italic created by using plot function in R?
- How to display fraction in a plot title using ggplot2 in R?
- How to represent the legend in a plot created by using plot function with colored straight lines or stars in R?
- How to create a plot in R with gridlines using plot function?
- How to make a plot title partially bold using ggplot2 in R?
- How to join points on a scatterplot with smooth lines in R using plot function?
- How to plot multiple time series using ggplot2 in R?
- How to create a plot in R with a different plot window size using plot function?
- How to change the Y-axis title in base R plot?
- How to create a plot title with unicode characters using ggplot2 in R?
- How to write text outside plot using ggplot2 in R?

Advertisements