我想在坐標中間有一個“洞”,但沒有顯示。嘗試更改 x 變數。有任何想法嗎?
structure(list(name = c("g__Bradyrhizobium", "g__Bradyrhizobium",
"g__Cutibacterium", "g__Cutibacterium"), primaryTumorLocation = c("Small intestine",
"Urothelial tract", "Small intestine", "Urothelial tract"), absolute = c(2L,
10L, 9L, 25L), Freq = c(0.032258064516129, 0.072992700729927,
0.145161290322581, 0.182481751824818), percent = c(7.5, 16.9,
33.5, 42.2)), row.names = c(1390L, 1397L, 2470L, 2477L), class = "data.frame")
ggplot(df)
geom_col(aes(x=4,y=Freq))
coord_polar("y",start = 0,direction = 1)
facet_grid(name~primaryTumorLocation)
uj5u.com熱心網友回復:
手動設定 x 位置的限制沒有幫助嗎?下面,scale_x_continuous(limits = c(3, NA))將下限設定為 3。如果您想要更大的孔,可以選擇更小的限制。
library(ggplot2)
#> Warning: package 'ggplot2' was built under R version 4.1.1
df <- structure(
list(
name = c("g__Bradyrhizobium", "g__Bradyrhizobium",
"g__Cutibacterium", "g__Cutibacterium"),
primaryTumorLocation = c("Small intestine", "Urothelial tract",
"Small intestine", "Urothelial tract"),
absolute = c(2L, 10L, 9L, 25L),
Freq = c(0.032258064516129, 0.072992700729927, 0.145161290322581,
0.182481751824818),
percent = c(7.5, 16.9, 33.5, 42.2)
),
row.names = c(1390L, 1397L, 2470L, 2477L),
class = "data.frame"
)
ggplot(df)
geom_col(aes(x=4,y=Freq))
coord_polar("y",start = 0,direction = 1)
scale_x_continuous(limits = c(3, NA))
facet_grid(name~primaryTumorLocation)

由reprex 包(v2.0.1)于 2021 年 10 月 27 日創建
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/341817.html
上一篇:從生存資料繪制劑量反應曲線
