Created
May 19, 2013 06:48
-
-
Save yoavram/5606906 to your computer and use it in GitHub Desktop.
How to change where the horizontal axis crosses the vertical axis in geom_bar? The result of http://stackoverflow.com/questions/16537401/how-to-change-where-the-horizontal-axis-crosses-the-vertical-axis-in-geom-bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
data <- c(0.3,0.4,0.5,0.6,0.7,0.8) | |
qplot(x=1:6, y=data - 0.5, geom="bar", stat="identity") + | |
scale_y_continuous(breaks=c(-0.5,-0.25,0,0.25,0.5), limits=c(-0.5,0.5), labels=c(0,0.25,0.5,0.75,1.0)) + | |
labs(y="",x="") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment