- 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 border color of box of a base R plot?
To change the border color of box of a base R plot, we can use box function with col argument where we can pass the color other than black because black is the default color. We first need to create the plot using plot function and then box function will be used as shown in the below examples.
Example 1
To change the border color of box of a base R plot, use the command given below −
plot(1:10) box(col="red")
Output
If you execute the above given command, it generates the following output −
Example 2
To change the border color of box of a base R plot, use the command given below −
plot(5) box(col="green")
Output
If you execute the above given command, it generates the following output −
- Related Articles
- How to change the color of box of boxplot in base R?
- How to change the background color of base R plot region?
- How to change the plot border color of a ggplot2 graph in R?
- 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 resolution of a plot in base R?
- How to change the color of bars in base R barplot?
- How to change the border style of a plot using ggplot2 in R?
- How to create a colored box for base R plot?
- How to change the color of outliers in base R boxplot?\n
- How to change the background color of a plot created by using plot function in R?
- 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 color of bars of a bar plot using ggplot2 in R?

Advertisements