# How to Increase the radius of a circle using Coord_polar()

I have a doughnut sort of plot which i plot using the ggplot2.

``````data.frame(
stringsAsFactors = FALSE,
Tenure.Type = c("Tenure_A","Tenure_B",
"Tenure_C","Tenure_D","Tenure_E"),
In.Poverty = c(45786L, 98453L, 34954L, 29586L, 74854L),
Not.in.Poverty = c(784733L, 359584L, 385884L, 948434L, 385869L)
) -> Poverty

library(tidyverse)
Poverty %>%
pivot_longer(-Tenure.Type) %>%
uncount(round(value/1000)) %>%
ggplot(aes(1, name, color = Tenure.Type)) +
geom_jitter() +
coord_polar()
``````

This is what i got -

I was wondering if there is any way to increase the size/surface area of the outer ring while keeping the inner ring as it is. Thanks.

I tried using the agruments inside the Coord_polar() but I can't get it to work.

Note - If you can notice, in the plot each dot represents 1000 observations. So, is there something in which we can achieve like each outer ring's dot represents 10,000 observations and each inner ring's dot represent 1,000 observations? Thanks.

One approach to control the radius is to create `geom_jitter()` plots from different subsets of the data and specify a unique width for each. Below is an example, as well as possible outputs. Adjust the widths until the desired output is achieved.

``````library(tidyverse)

Poverty = data.frame(
stringsAsFactors = FALSE,
Tenure.Type = c("Tenure_A","Tenure_B",
"Tenure_C","Tenure_D","Tenure_E"),
In.Poverty = c(45786L, 98453L, 34954L, 29586L, 74854L),
Not.in.Poverty = c(784733L, 359584L, 385884L, 948434L, 385869L)
)

df = Poverty %>%
pivot_longer(-Tenure.Type) %>%
uncount(round(value/1000))

in_poverty = df %>% filter(name == 'In.Poverty')
not_in_poverty = df %>% filter(name == 'Not.in.Poverty')

ggplot() +
geom_jitter(data = in_poverty, aes(1, name, color = Tenure.Type), height = 0.25) +
geom_jitter(data = not_in_poverty, aes(1, name, color = Tenure.Type), height = 0.5) +
coord_polar()
``````

Created on 2023-01-31 with reprex v2.0.2.9000

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.