Hi, I am trying to change the values of the tick marks on the xaxis of the following multipanel plot (see relevant bits of script below) to increments of 50 or to a custom scale (ie. 50, 100, 150, 200, 300...). So far I tried using xaxp or xlim both in par() or lineplot.CI(), as well as axTicks and axisTicks but did not get it to work. Suggestions? #Plots average A/Ci for each day from ACi #Parameters of the panels par(mfcol=c(3,2), #row,col mar=c(2,2,1,1), #inner margin (bottom, left, top, right) oma=c(4,4,1,1), #outer margin (bottom, left, top, right) omd=c(0.1,0.8,0.1,0.95), #outer dimensions, values {0-1}, (x1, x2, y1, y2) xpd=NA) ... #PAR = 1000, Day2 with(subset1000_2, lineplot.CI(x.factor=Ci.average, response=Photo, group=Treatment, ylab=NA, xlab=NA, legend=FALSE, type="p", x.cont=TRUE, #continuous x axis (spacing proportional to values) ylim=c(1,45), #range y axis err.width=0.05, pch = c(16,16,16), #symbols shape col=c("gray84","black","gray48"), fun )) mtext("Day2, PAR=1000", side = 3, line= -1, adj=0, at=1, cex=0.6) #subtitle .... #legends mtext("Ci", side = 1, line= 1, outer = TRUE, cex=0.7) #x legend mtext("Photosynthetic rate", side = 2, line= 1, outer = TRUE, cex=0.7) #y legend Thank you kindly for your support. Clemence [[alternative HTML version deleted]]
Hi Clemence, I don't have sciplot installed, but the help page suggests that the "xaxt" argument is available. This will prevent the x axis from being displayed and you can then specify the x axis you want. Assume that you want an x axis from 0 to 300 by 50: axis(1,at=seq(0,300,by=50)) Jim On Thu, Jun 30, 2016 at 12:04 PM, Clemence Henry <C.Henry at westernsydney.edu.au> wrote:> Hi, > > I am trying to change the values of the tick marks on the xaxis of the following multipanel plot (see relevant bits of script below) to increments of 50 or to a custom scale (ie. 50, 100, 150, 200, 300...). > So far I tried using xaxp or xlim both in par() or lineplot.CI(), as well as axTicks and axisTicks but did not get it to work. > Suggestions? > > #Plots average A/Ci for each day from ACi > #Parameters of the panels > par(mfcol=c(3,2), #row,col > mar=c(2,2,1,1), #inner margin (bottom, left, top, right) > oma=c(4,4,1,1), #outer margin (bottom, left, top, right) > omd=c(0.1,0.8,0.1,0.95), #outer dimensions, values {0-1}, (x1, x2, y1, y2) > xpd=NA) > > ... > > > #PAR = 1000, Day2 > with(subset1000_2, > lineplot.CI(x.factor=Ci.average, > response=Photo, > group=Treatment, > ylab=NA, > xlab=NA, > legend=FALSE, > type="p", > x.cont=TRUE, #continuous x axis (spacing proportional to values) > ylim=c(1,45), #range y axis > err.width=0.05, > pch = c(16,16,16), #symbols shape > col=c("gray84","black","gray48"), > fun> )) > mtext("Day2, PAR=1000", side = 3, line= -1, adj=0, at=1, cex=0.6) #subtitle > > .... > > #legends > mtext("Ci", side = 1, line= 1, outer = TRUE, cex=0.7) #x legend > mtext("Photosynthetic rate", side = 2, line= 1, outer = TRUE, cex=0.7) #y legend > Thank you kindly for your support. > > Clemence > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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 Jun 29, 2016, at 7:04 PM, Clemence Henry <C.Henry at westernsydney.edu.au> wrote: > > Hi, > > I am trying to change the values of the tick marks on the xaxis of the following multipanel plot (see relevant bits of script below) to increments of 50 or to a custom scale (ie. 50, 100, 150, 200, 300...). > So far I tried using xaxp or xlim both in par() or lineplot.CI(), as well as axTicks and axisTicks but did not get it to work. > Suggestions?I don?t see a reproducible example so I?m not giving tested advice, but looking at the code for sciplot::lineplot.CI it appears that it might honor an ?xlim' argument and accept xaxt=?n? and then you should be able to add axTicks as you specify. If you choose to post again on the matter you should use `dput(object name)` to get a version of data suitable for testing. ? David.> > #Plots average A/Ci for each day from ACi > #Parameters of the panels > par(mfcol=c(3,2), #row,col > mar=c(2,2,1,1), #inner margin (bottom, left, top, right) > oma=c(4,4,1,1), #outer margin (bottom, left, top, right) > omd=c(0.1,0.8,0.1,0.95), #outer dimensions, values {0-1}, (x1, x2, y1, y2) > xpd=NA) > > ... > > > #PAR = 1000, Day2 > with(subset1000_2, > lineplot.CI(x.factor=Ci.average, > response=Photo, > group=Treatment, > ylab=NA, > xlab=NA, > legend=FALSE, > type="p", > x.cont=TRUE, #continuous x axis (spacing proportional to values) > ylim=c(1,45), #range y axis > err.width=0.05, > pch = c(16,16,16), #symbols shape > col=c("gray84","black","gray48"), > fun> )) > mtext("Day2, PAR=1000", side = 3, line= -1, adj=0, at=1, cex=0.6) #subtitle > > .... > > #legends > mtext("Ci", side = 1, line= 1, outer = TRUE, cex=0.7) #x legend > mtext("Photosynthetic rate", side = 2, line= 1, outer = TRUE, cex=0.7) #y legend > Thank you kindly for your support. > > Clemence > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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, I used the "axis()" suggested by Jim as follows and it worked: #Plots average A/Ci for each day from ACi #Parameters of the panels par(mfcol=c(3,2), #row,col mar=c(2,2,1,1), #inner margin (bottom, left, top, right) oma=c(4,4,1,1), #outer margin (bottom, left, top, right) omd=c(0.1,0.8,0.1,0.95), #outer dimensions, values {0-1}, (x1, x2, y1, y2) xpd=NA) #PAR = 1000, Day0 with(subset1000_0, lineplot.CI(x.factor=Ci.average, response=Photo, group=Treatment, ylab=NA, xlab=NA, legend=TRUE, x.leg=1000, y.leg=18, type="p", x.cont=TRUE, #continuous x axis (spacing proportional to values) xaxt='n', #remove x axis labels xlim=c(0,1150), #range x axis ylim=c(1,45), #range y axis err.width=0.05, pch = c(16,16,16), #symbols shape col=c("gray84","black","gray48"), fun )) mtext("Day0, PAR=1000", side = 3, line= -1, adj=0, at=1, cex=0.6) #subtitle axis(1, at=c(0,25,50,100,150,200,300,400,500,600,700,800,900,1000,1100), labels=NULL) #replace xaxes with desired values Thanks everyone, Clem -----Original Message----- From: Jim Lemon [mailto:drjimlemon at gmail.com] Sent: Sunday, 3 July 2016 7:04 PM To: Clemence Henry Cc: r-help at r-project.org Subject: Re: [R] lineplot.CI xaxis scale change in sciplot? Hi Clemence, I don't have sciplot installed, but the help page suggests that the "xaxt" argument is available. This will prevent the x axis from being displayed and you can then specify the x axis you want. Assume that you want an x axis from 0 to 300 by 50: axis(1,at=seq(0,300,by=50)) Jim On Thu, Jun 30, 2016 at 12:04 PM, Clemence Henry <C.Henry at westernsydney.edu.au> wrote:> Hi, > > I am trying to change the values of the tick marks on the xaxis of the following multipanel plot (see relevant bits of script below) to increments of 50 or to a custom scale (ie. 50, 100, 150, 200, 300...). > So far I tried using xaxp or xlim both in par() or lineplot.CI(), as well as axTicks and axisTicks but did not get it to work. > Suggestions? > > #Plots average A/Ci for each day from ACi #Parameters of the panels > par(mfcol=c(3,2), #row,col > mar=c(2,2,1,1), #inner margin (bottom, left, top, right) > oma=c(4,4,1,1), #outer margin (bottom, left, top, right) > omd=c(0.1,0.8,0.1,0.95), #outer dimensions, values {0-1}, (x1, x2, y1, y2) > xpd=NA) > > ... > > > #PAR = 1000, Day2 > with(subset1000_2, > lineplot.CI(x.factor=Ci.average, > response=Photo, > group=Treatment, > ylab=NA, > xlab=NA, > legend=FALSE, > type="p", > x.cont=TRUE, #continuous x axis (spacing proportional to values) > ylim=c(1,45), #range y axis > err.width=0.05, > pch = c(16,16,16), #symbols shape > col=c("gray84","black","gray48"), > fun> )) > mtext("Day2, PAR=1000", side = 3, line= -1, adj=0, at=1, cex=0.6) > #subtitle > > .... > > #legends > mtext("Ci", side = 1, line= 1, outer = TRUE, cex=0.7) #x legend > mtext("Photosynthetic rate", side = 2, line= 1, outer = TRUE, cex=0.7) > #y legend Thank you kindly for your support. > > Clemence > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.