Is there a way to be able to set both the axis range and the number of tick marks in the python implementation of ggplot for a scatterplot? For example, I want to set the y-axis to be from 0 to 100 with a tick at values 0, 10, 20, 30,...,100.
I've tried the following:
ggplot(aes(x=x, y=y), data=data) + geom_point() + scale_y_continuous(limits=(0,100), breaks=range(0,100,10))
ggplot(aes(x=x, y=y), data=data) + geom_point() + scale_y_continuous(breaks=range(0,100,10)) + ylim(0,100)
ggplot(aes(x=x, y=y), data=data) + geom_point() + scale_y_continuous(breaks=range(0,100,10))
In the first two lines, the limits override the breaks, so I get an axis from 0 to 100 but the tick marks do not appear. In the last line, the breaks do appear, but the range is only the automatic range that ggplot uses from the data, rather than the desired 0 to 100 range.