這是我的代碼。我用過ggplot2。我想改變是單獨Y軸值在PIC下面提到如何更改qqplot中的y軸值
library(ggplot2)
rm(list=ls())
bar=read.csv("Age.csv")
attach(bar)
Category=sub('\\s+$', '', Category)
HSI = HSI-100
df = data.frame(HSI=HSI,Category)
ggplot(df, aes(x=Category,y=HSI, fill=Category)) +
geom_bar(stat = "identity", aes(width=0.3)) + # adjust width to change thickness
geom_text(aes(label=HSI+100, y=HSI+2*sign(HSI)),# adjust 1.1 - to change how far away from the final point the label is
size=5 # adjust the size of label text
)
爲什麼從HSI中刪除100,然後將100添加到geom_text? 它應該按照你的想法保持恆生指數的原始價值。 – xraynaud
@xraynaud其實我想在barplot中的條應該從100開始。如果HSI值小於100並且反之亦然,它會顯示下降... –