[英]How do I tell python what my data structure (that is in binary) looks like so I can plot it?
[英]How can I create a plot in R that looks like the attached image?
我必须创建像图像一样的圆形图
我的数据是这样的
我必须在 R 中创建看起来像附件图像的圆形图?
您只提供了少量数据点(实际上只是少量数据点的图片)。 使这些在 R 中可重现,我们有:
df <- data.frame(col1 = c(2, 26, 26, 27, 27, 28, 28, 28),
col2 = c(94, 146, 175, 213, 213, 55, 247, 263))
我们可以像这样绘制结果(只是一个圆形图):
library(tidygraph)
library(ggraph)
df %>%
bind_rows(data.frame(col1 = 1:360, col2 = 1:360)) %>%
arrange(col1) %>%
as_tbl_graph() %>%
activate(edges) %>%
mutate(diff = as.character(abs(from - to))) %>%
ggraph(layout = "linear", circular = TRUE) +
geom_edge_arc(aes(colour = diff), lwd = 1) +
ggforce::geom_circle(aes(x0 = 0, y0 = 0, r = 1.024), size = 15,
color = '#fff450') +
geom_node_text(aes(label = ifelse(as.numeric(name) %% 10 == 0, name, ""),
angle = -as.numeric(name) + 90)) +
coord_equal() +
theme_graph() +
theme(plot.background = element_rect(fill = 'black'),
legend.position = 'none')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.