简体   繁体   English

Plot 带圆圈

[英]Plot with circlize

I work with library circlize and I made plot. Below you can see code我与图书馆 circlize 合作,制作了 plot。下面你可以看到代码

library(circlize)
random_values<-c(500:100)

random_sample<-sample(random_values,15)

col.pal = c(BMW = "red",
            Honda = "green",
            Nissan = "blue",
            Tesla = "grey",
            Toyota = "maroon",
            Phoenix = "grey",
            Tucson = "black",
            Sedona = "grey"
              )
Sample_Matrix <- matrix( 
                    random_sample,
                    nrow = 5,
          dimnames = list(c("BMW","Honda","Nissan","Tesla","Toyota"),
                          c("Phoenix","Tucson","Sedona")))

chordDiagram(Sample_Matrix,grid.col = col.pal)
                                                    

Now I want to use the title on this Title on this plot. Frequently I used ggplot2 and I have a title with the same font as ggplot2 to produce the plot. Can anybody help me how to this?现在我想在这个 plot 上使用这个标题上的标题。我经常使用 ggplot2 并且我有一个与 ggplot2 相同字体的标题来生成 plot。有人可以帮我怎么做吗?

You can use this code to add a title:您可以使用此代码添加标题:

chordDiagram(Sample_Matrix,grid.col = col.pal, annotationTrackHeight = c(0.03, 0.01), title(main = "title"))

Output: Output:

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM