HI @ all, I'm looking for a simple solution to supress the y-axis - but only the drawn scale - not the values. Only the numbers should be displayed. I tried yaxt="n" but there everything of the y-axis is supressed. Thanks GeO -- View this message in context: http://r.789695.n4.nabble.com/no-y-axis-tp4649298.html Sent from the R help mailing list archive at Nabble.com.
Hello, Like this? plot(1:10, yaxt = "n") axis(2, at = 1:10, labels = 1:10, tick = FALSE) Hope this helps, Rui Barradas Em 12-11-2012 10:08, Geophagus escreveu:> HI @ all, > I'm looking for a simple solution to supress the y-axis - but only the drawn > scale - not the values. > Only the numbers should be displayed. > I tried yaxt="n" but there everything of the y-axis is supressed. > Thanks > GeO > > > > > -- > View this message in context: http://r.789695.n4.nabble.com/no-y-axis-tp4649298.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Hi and thanks for your answer, I need no axis - only the labels. In your example 1 to 10. Greetz GeO -- View this message in context: http://r.789695.n4.nabble.com/no-drawn-y-axis-but-values-tp4649298p4649324.html Sent from the R help mailing list archive at Nabble.com.
Hello, If you want to completely remove the axis, overplot in color white. plot(1:10, yaxt = "n") axis(2, at = 1:10, labels = 1:10, tick = FALSE) axis(2, at = 1:10, labels = 1:10, col = "white") Hope this helps, Rui Barradas Em 12-11-2012 17:18, Geophagus escreveu:> Hi and thanks for your answer, > > I need no axis - only the labels. > In your example 1 to 10. > > Greetz > GeO > > > > -- > View this message in context: http://r.789695.n4.nabble.com/no-drawn-y-axis-but-values-tp4649298p4649324.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
HI, May be this helps: ?par(bty="n") ?plot(1:10,yaxt="n") ?axis(2, at = 1:10, labels = 1:10, tick = FALSE) A.K. ----- Original Message ----- From: Geophagus <fh at retposto.net> To: r-help at r-project.org Cc: Sent: Monday, November 12, 2012 12:18 PM Subject: Re: [R] no y-axis Hi and thanks for your answer, I need no axis - only the labels. In your example 1 to 10. Greetz GeO -- View this message in context: http://r.789695.n4.nabble.com/no-drawn-y-axis-but-values-tp4649298p4649324.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
On 11/13/2012 06:59 AM, Geophagus wrote:> thanks, that works fine! good idea. > > I have one last question regarding this problem. > My y-scale now is grouped from 0 - 4000 in 1000. > Is it possible to set the scale into not equal breaks like > 5,10,100,1000,5000 ? > > My axis now: > axis(2,at=seq(0,4000,1000),col = "white", las=1) >Hi GeO, I would suggest using mtext rather than axis. mtext(c(5,10,100,1000,5000),at=c(5,10,100,1000,5000), side=2,line=1) You may need to twiddle this a bit to get it right. Jim
Hi Jim and thanks for your answer. It does not work how I want. When I use your proposal, the values are superimposed like shown on the pic. pic.png <http://r.789695.n4.nabble.com/file/n4649368/pic.png> Thats my code (what I need is a y-scale with the following interrupts: 5,10,100,1000,5000): plot(BE_UK_ABFG$year, BE_UK_ABFG$ammo, type="s", col= "#DB270F", xaxt="n", #yaxt="n", ylim=c(0,5000), xlab="", ylab="", main="Ammo Rep 1885b", adj=0, las = 1, lwd=3, bty="n" ) abline(h=0:0, lwd=1, col="black") abline(h=1000:1000, lwd=0.3, col="darkgray", lty="dashed") abline(h=2000:2000, lwd=0.3, col="darkgray", lty="dashed") abline(h=3000:3000, lwd=0.3, col="darkgray", lty="dashed") abline(h=4000:4000, lwd=0.3, col="darkgray", lty="dashed") abline(h=5000:5000, lwd=0.3, col="darkgray", lty="dashed") lines (BE_UK_AW$year, BE_UK_AW$ammo, type="s", col= "#826A9F", lwd=3.5) axis(1,at=seq(2007,2010)) mtext(c(5,10,100,1000,5000),at=c(5,10,100,1000,5000),side=2,line=1, las=1) Thank you and best greetings GeO -- View this message in context: http://r.789695.n4.nabble.com/no-drawn-y-axis-but-values-tp4649298p4649368.html Sent from the R help mailing list archive at Nabble.com.
On 11/13/2012 11:01 PM, Geophagus wrote:> Hi Jim and thanks for your answer. > It does not work how I want. When I use your proposal, the values are > superimposed like shown on the pic. > > pic.png<http://r.789695.n4.nabble.com/file/n4649368/pic.png> > > Thats my code (what I need is a y-scale with the following interrupts: > 5,10,100,1000,5000): >Hi Geo, I see. Try this: plot(BE_UK_ABFG$year, BE_UK_ABFG$ammo, type="s", col= "#DB270F", yaxs="i", xaxt="n", yaxt="n", ylim=c(0,5000), xlab="", ylab="", main="Ammo Rep 1885b", adj=0, las = 1, lwd=3, bty="n" ) abline(h=0:0, lwd=1, col="black") abline(h=1000:1000, lwd=0.3, col="darkgray", lty="dashed") abline(h=2000:2000, lwd=0.3, col="darkgray", lty="dashed") abline(h=3000:3000, lwd=0.3, col="darkgray", lty="dashed") abline(h=4000:4000, lwd=0.3, col="darkgray", lty="dashed") abline(h=5000:5000, lwd=0.3, col="darkgray", lty="dashed") lines (BE_UK_AW$year, BE_UK_AW$ammo, type="s", col= "#826A9F", lwd=3.5) library(plotrix) axis(1,at=2007:2010) axis(2,at=seq(0,5000,by=1000),labels=c("",seq(1000,5000,by=1000)),las=1) mtext(c(5,10,100),at=c(-150,0,150),line=1,side=2,las=1) par(xpd=TRUE) # get rid of the bottom tick rect(2006.8,-10,2006.87,10,col="white",border=NA) segments(rep(2006.8,3),c(-150,0,150),rep(2006.88,3),c(5,10,100)) par(xpd=FALSE) Jim