問題:
I need to remove everything on the x-axis including the labels and tick marks so that only the y-axis is labeled.我需要刪除 x 軸上的所有內容,包括標籤和刻度線,以便僅標記 y 軸。 How would I do this?我該怎麼做?
In the image below I would like 'clarity' and all of the tick marks and labels removed so that just the axis line is there.在下圖中,我希望“清晰”並刪除所有刻度線和標籤,以便僅顯示軸線。
Sample ggplot示例 ggplot
data(diamonds)
ggplot(data = diamonds, mapping = aes(x = clarity)) + geom_bar(aes(fill = cut))
ggplot Chart: ggplot圖表:
Desired chart:所需圖表:
解決方案:
參考一: https://stackoom.com/question/2NEjz參考二: Remove all of x axis labels in ggplot [duplicate]