多くの値があるのでy軸を読み取ることができません。私はそれを回転させようとしました、そして、私がしたいのと同じように動作しません。ggplot2 R、軸で多くの値を固定する(ラインプロット)
私は軸の値を20から30のように指定したいと思います。
しかし、値の長さは1000ですので、上記の範囲はうまくいかないと思います(?)。 例:
runNumbers <- seq(from = 1, to = 1000)
tempVector <- seq(from = 20.0010, to = 30, by = 0.01)
plotData <- data.frame(RunNumber = runNumbers, temp = tempVector,
myUglyPlot <- ggplot(data = plotData, mapping = aes(x = RunNumber, y = temp, group = 1)) + geom_line()
#
#http://stackoverflow.com/questions/14428887/overflowing-x-axis-ggplot2?noredirect=1&lq=1
require(scales) # for removing scientific notation
# manually generate breaks/labels
labels <- seq(from = 0, to = 30, length.out = 1000)
# and set breaks and labels
myUglyPlot <- myUglyPlot + scale_y_discrete(breaks = labels, labels = as.character(labels))
# And now my graph is without labels, why?
私のラベルを回転させず、これを行うための別の方法はありますか?あるいは、私は他の質問からコードに何か間違っているのですか(私は彼がしたことに従いました...)?
後、私が代わりに10の000の値を持つことになりますので、私は本当に私は間隔を置くことができることを、私は読みやすい軸を持ちたい、これを変更する必要があります。
をたぶん私はいくつかの単純な概念に欠けています私はR Graphics Cookbookを検索して読んでみましたが、今は成功していません。
お時間をいただきありがとうございます。
更新 私は助けてくれてありがとうございます。私が今やっていることは次のとおりです(これだけです):
myUglyPlot <- ggplot(data = plotData, mapping = aes(x = RunNo, y = t_amb, group = 1)) + geom_line()
myUglyPlot <- myUglyPlot + scale_y_discrete(breaks=seq(from = 1, to = 50, by = 0.01))
しかし私には何の休憩も与えません。写真を参照してください。あなたは、ほとんど存在し
Googleの検索語が 'ggplot2軸breaks'はあなたを与えるだろうhttp://www.sthda.com/english/wiki/ggplot2-axis-ticks-a-guide-to-customize-tick-marks-and -labels、http://stackoverflow.com/questions/11335836/increase-number-of-axis-ticks-in-ggplot2、http://stackoverflow.com/questions/17764140/ggplot2-customised-x-axis-ticks 、そしてもっと多く... – Jimbou