I can't read my y-axis since is has a lot of values. I tried rotating it and it doesn't work like I want, neither is it something I want to do.
I want to specify the values in the axis, to be from say 20 to 30, maybe with step 0.1.
But the length of the values are 1000, so I guess the range suggested above doesn't work (?). Ex:
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?
Is there another way to do this, without rotating my labels? Or am I doing something wrong in the code from the other question (I tried to follow what he did...)?
Later I will have 10 000 values instead, so I really need to change this, I want to have a readable axis, that I can put the interval in.
Maybe I'm missing in some simple concept, I tried to search and read R Graphics Cookbook, but without success for now.
Thanks for your time.
Update Im trying to use breaks, thanks for the help guys. Here's what I'm doing now (only this):
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))
But my it doesn't give me any breaks. See pic.