我有一个看起来像这样的df
X | 是 |
---|---|
一个 | 3 |
乙 | 6 |
C | 4 |
D | 9 |
我想使用带有 4 个部分的 circlize 将其绘制在 circos 图中。每个部分都应该有 X 轴作为标题,并且在该部分中它应该有 Y 轴值。我只想直接从df中获取数据并将其绘制在circos图上
It's straightforward to do this in ggplot
:
library(ggplot2)
df <- data.frame(x = LETTERS[1:4], y = c(3, 6, 4, 9))
ggplot(df, aes(x = x, y = 1, fill = x)) +
geom_col(width = 1, color = "white") +
geom_text(aes(y = 0.6, label = y), size = 8) +
coord_polar() +
theme_void() +
scale_fill_brewer(palette = "RdYlGn") +
theme(axis.text.x = element_text(size = 16),
legend.position = "none")