This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to make a quarter circle polar plot using ggplot2?

Hello,

I am trying to make a polar plot/chart that goes 90 degrees (from 0 to 90 degree) instead of 360 using ggplot2. I need to visualise my data (angle and frequency) similar to these quarter circle polar plots Figure1

I ran the below codes, however, It is still a 360 degree circle polar plot:

d <- structure(list(Angle = c(10, 20, 30, 40, 50),
                Frequency = c(54.7, 30.2, 83.3, 16.7, 95)), .Names = c("Angle", "Frequency"),
           row.names = c(NA, 5L), class = "data.frame")

ggplot(d, aes(x = Angle, y = Frequency)) +
coord_polar(theta = "x", start = -pi/36, direction = 1) +
geom_bar(stat = "identity") +
scale_x_continuous(limits=c(0,90), breaks = seq(0, 90, 10))

I am not expert in R, so, I do not know what I am doing wrong. I searched a lot but still could not solve it. I would extremely appreciate if you could help me how to fix this problem to produce a quarter circle polar plot similar to the example figure. Best wishes,

ggplot2 coord_polar r quarter-circle-polar-plot

0 answers

No answers yet.

Log in to answer this question.