- 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 vertical lines in R?
We can create a circle in R by using draw.circle function of plotrix package and if we want to have vertical lines inside the circle then density and angle arguments will be used. The density argument will create the lines and angle argument will set the direction of those lines.
For vertical lines the angle will be 270 and the number of lines depends on the value of density argument.
Check out the below Examples to understand how different values of density create lines inside the circle.
Example
To create a circle in R, use the code given below −
plot(1:10,type="n")
Output
If you execute the above given snippet, it generates the following Output −
To create a circle in R, add the following code to the above snippet −
plot(1:10,type="n") draw.circle(5,5,1,density=5,angle=270)
Output
If you execute all the above given snippets as a single program, it generates the following Output −
To create a circle in R, add the following code to the above snippet −
plot(1:10,type="n") draw.circle(5,5,1,density=8,angle=270)
Output
If you execute all the above given snippets as a single program, it generates the following Output −
- Related Articles
- How to create dotted vertical lines in a plot using ggplot2 in R?
- How to create two vertical lines on a plot with shaded area in-between using R?
- How to create a circle filled with a color in R?
- How to create a circle with different color border in R?
- How to create a line chart using ggplot2 with a vertical line in R?
- How to create a stacked bar plot with vertical bars in R using ggplot2?
- How to create a wide vertical line using ggplot2 with different color in R?
- How to display vertical grid lines in a table with Java?
- How to create vertical line in xyplot in R?
- How to create a dotted vertical line using ggplot2 in R?
- How to create multiple lines chart with unique line types in R?
- How to create horizontal lines with two different colors after a threshold in R?
- How to create a vertical menu with CSS?
- How to create a vertical line with CSS?
- How to create a plot in base R with tick marks but excluding axes lines?
