- 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 create a circle with different color border in R?
We can create a circle in R by using draw.circle function of plotrix package and default border color of the circle is black. If we want to change the border color of a circle then we can use border argument and pass the desired colors.
For Example, if we want to create a blue colored circle then, we can use the below mentioned command −
draw.circle(5,5,2,border="blue")
Check out the below Example to understand how it works.
Example
To create a colored circle add the following code to the above snippet −
plot(1:10,type="n")
Output
If you execute the above given snippet, it generates the following Output −
To create a colored circle add the following code to the above snippet −
plot(1:10,type="n") library(plotrix) draw.circle(5,5,2)
Output
If you execute all the above given snippets as a single program, it generates the following Output −
To create colored circle add the following code to the above snippet −
plot(1:10,type="n") library(plotrix) draw.circle(5,5,2,border="red")
Output
If you execute all the above given snippets as a single program, it generates the following Output −
To create colored circle add the following code to the above snippet −
plot(1:10,type="n") library(plotrix) draw.circle(5,5,2,border="blue")
Output
If you execute all the above given snippets as a single program, it generates the following Output −
- Related Articles
- How to create a circle filled with a color in R?
- How to create a horizontal line in ggplot2 graph with different color in R?
- How to create a wide vertical line using ggplot2 with different color in R?
- How to create histogram like plot with different color of bars in R?
- How to create a Circle with border colour using FabricJS?
- How to create a barplot with one of the bars having different color in R?
- How to create an Ellipse with a border color using FabricJS?
- How to create a Circle with dash pattern border using FabricJS?
- How to create a circle with vertical lines in R?
- How to change the border style of a circle in R?
- How to change the border color of points in a scatterplot created with ggplot2 in R?
- How to create a scatterplot using ggplot2 with different shape and color of points based on a variable in R?
- How to create a Matte-look border using a solid color in Java?
- How to fill the outliers with different color in base R boxplot?
- How to change the plot border color of a ggplot2 graph in R?
