刪除ggplot中的所有x軸標籤[重複] - Remove all of x axis labels in ggplot [duplicate]

問題:

This question already has answers here : 這個問題在這裏已經有了答案
Closed 5 years ago . 5年前關閉。

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]
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章