當ggplot使用極座標繪製線圖時,它會在最高和最低x值(下面的Dec
和Jan
)之間留下間隙,而不是纏繞成螺旋線。我怎樣才能延續這條路線並縮小差距?極線ggplot圖中的連接間隙
特別是,我想使用月份作爲我的x軸,但在一條循環線中繪製多年的數據。
Reprex:
library(ggplot2)
# three years of monthly data
df <- expand.grid(month = month.abb, year = 2014:2016)
df$value <- seq_along(df$year)
head(df)
## month year value
## 1 Jan 2014 1
## 2 Feb 2014 2
## 3 Mar 2014 3
## 4 Apr 2014 4
## 5 May 2014 5
## 6 Jun 2014 6
ggplot(df, aes(month, value, group = year)) +
geom_line() +
coord_polar()
[相關](http://stackoverflow.com/questions/41603341/spiral-barplot-using-ggplot-coord-polar-condegram/41610220#41610220)。 – Axeman