Skip to content

Instantly share code, notes, and snippets.

@timriffe
Created November 28, 2011 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timriffe/1399920 to your computer and use it in GitHub Desktop.
Save timriffe/1399920 to your computer and use it in GitHub Desktop.
hacky way and correct way to get comma axes
x <- seq(0,1,by=.01)
y <- runif(101)
# the hacky way:
plot(x,y,axes=F)
box()
axis(side=1,at=seq(0,1,by=.2),labels=c(paste("0,",seq(0,8,by=2),sep=""),"1,0"))
axis(side=2,at=seq(0,1,by=.2),labels=NA)
text(x=-.05,y=seq(0,1,by=.2),
labels=c(paste("0,",
seq(0,8,by=2),sep=""),"1,0"),
xpd=T,
pos=2)
# the super-parsimonious correct way:
options(OutDec=",")
plot(x,y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment