0

我有一个看起来像这样的df

X
一个 3
6
C 4
D 9

我想使用带有 4 个部分的 circlize 将其绘制在 circos 图中。每个部分都应该有 X 轴作为标题,并且在该部分中它应该有 Y 轴值。我只想直接从df中获取数据并将其绘制在circos图上

4

1 回答 1

0

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")

enter image description here

于 2022-01-27T10:47:56.800 回答