How to change the border style of a circle in R?

R ProgrammingServer Side ProgrammingProgramming

<p>We can create a circle in R by using draw.circle function of plotrix package and default border will be like straight lines. If we want to change the border style of a circle then we can use lty argument and set it to different values as shown in the below Examples.</p><h2>Example</h2><p>To change the border style of a circle in R use the following snippet &minus;</p><pre class="demo-code notranslate language-rscript" data-lang="rscript">plot(1:10,type=&quot;n&quot;)</pre><h2>Output</h2><p>If you execute the above given snippet, it generates the following Output &minus;</p><p><img class="fr-fic fr-dii"><img src="https://www.tutorialspoint.com/assets/questions/media/58925/125.1ques.png" class="fr-fic fr-dib" width="568" height="552"></p><p>To change the border style of a circle in R add the following code to the above snippet &minus;</p><pre class="just-code notranslate language-rscript" data-lang="rscript">plot(1:10,type=&quot;n&quot;) library(plotrix) draw.circle(5,5,2) </pre><h2>Output</h2><p>If you execute all the above given snippets as a single program, it generates the following Output &minus;</p><p><img src="https://www.tutorialspoint.com/assets/questions/media/58925/125.2ques.png" class="fr-fic fr-dib" width="568" height="552"><img class="fr-fic fr-dii"></p><p>To change the border style of a circle in R add the following code to the above snippet &minus;</p><pre class="just-code notranslate language-rscript" data-lang="rscript">plot(1:10,type=&quot;n&quot;) library(plotrix) draw.circle(5,5,2,lty=9)</pre><h2>Output</h2><p>If you execute all the above given snippets as a single program, it generates the following Output &minus;</p><p><img class="fr-fic fr-dii"><img src="https://www.tutorialspoint.com/assets/questions/media/58925/125.3ques.png" class="fr-fic fr-dib" width="568" height="552"></p><p>To change the border style of a circle in R add the following code to the above snippet &minus;</p><pre class="just-code notranslate language-rscript" data-lang="rscript">plot(1:10,type=&quot;n&quot;) library(plotrix) draw.circle(5,5,2,lty=20)</pre><h2>Output</h2><p>If you execute all the above given snippets as a single program, it generates the following Output &minus;</p><p><img class="fr-fic fr-dii"><img src="https://www.tutorialspoint.com/assets/questions/media/58925/125.4ques.png" class="fr-fic fr-dib" width="568" height="552"></p>
raja
Updated on 05-Nov-2021 07:17:23

Advertisements