- 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 create a circle filled with a color in R?
We can create a circle in R by using draw.circle function of plotrix package and default color of the circle is white. If we want to change the color of a circle then we can use col argument and pass the desired colors.
For Example, if we want to create a blue colored circle then we can use the command given below −
draw.circle(5,5,2,col="blue")
Check out the below Example to understand how it works.
Example
To create a circle filled with a colour, use the command given below −
plot(1:10,type="n")
Output
If you execute the above command, it generates the following Output −
To create a circle filled with a colour, add the following code to the above command −
plot(1:10,type="n") library(plotrix) draw.circle(5,5,2,col="red")
Output
If you execute all the above given commands as a single program, it generates the following Output −
To create a circle filled with a colour, add the following code to the above command −
plot(1:10,type="n") library(plotrix) draw.circle(5,5,2,col="green")
Output
If you execute all the above given commands as a single program, it generates the following Output −
- Related Articles
- How to create a circle with different color border in R?
- How to create a bar plot in R filled with color palette in RColorBrewer package?
- Draw a circle filled with random color squares on HTML5 canvas
- How to create a circle with vertical lines in R?
- How to create a graph in base R with multiple shades of a particular color?
- 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 density plot for categories filled with different colors in R?
- How to create a barplot with one of the bars having different color in R?
- How to draw a filled circle in OpenCV using Java?
- How to create the bar chart with ggplot2 using color brewer in R?
- How to create histogram like plot with different color of bars in R?
- How to create a canvas with Circle using FabricJS?
- How to create a canvas with a background color using FabricJS?
- How to create a zero-filled JavaScript array?
