Question: How to make a quarter circle polar plot using ggplot2?
0
gravatar for F. Golestan
5 months ago by
F. Golestan60
F. Golestan60 wrote:

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,

ADD COMMENTlink written 5 months ago by F. Golestan60
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1919 users visited in the last hour