- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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 change the background color of base R plot region?
To change the background color of base R plot region, we can follow the below steps −
First of all, create a plot in base R to understand the difference.
Then, use par function with bg argument where you can put color name and then create the same plot.
Example
Create the plot
Let’s create a barplot in base R as shown below −
x<-sample(1:10,3) barplot(x)
Output
Create the plot with changed background color
Using par function with bg argument having yellow color and then creating the barplot −
x<-sample(1:10,3) par(bg="yellow") barplot(x)
Output
- Related Articles
- How to change the background color of legend in base R plot?
- How to change the axis color in base R plot?
- How to change the axis ticks color in base R plot?
- How to change the border color of box of a base R plot?
- How to change the background color of a plot created by using plot function in R?
- How to change the color of bars in base R barplot?
- How to change the resolution of a plot in base R?
- How to change the color of box of boxplot in base R?
- How to change the partial plot background using ggplot2 in R?
- How to change the color of outliers in base R boxplot?\n
- How to change the font size of legend in base R plot?
- How to change the position of X-axis in base R plot?
- How to change the Y-axis title in base R plot?
- How to manually set the color of each bar in base R bar plot?
- How to change the plot border color of a ggplot2 graph in R?

Advertisements