Dear listmembersI wouldlike to remove in a dotplot() the border/frame from the figure and only keepthe x- and y-axis. I can?t find a way to do this. bty="n" does notwork. Can somebody help? I include the r coding for my figure below.?dotplot(plant_species ~ mean, data =botany,????????????aspect= 1.5,??????????? scales=list(x=list(tck=c(-1,0)),y = list(tck=c(-1,0))),??????????? ylab= "Plant species",??????????? xlim= c(-1.1, 1.1),??????????? xlab= "Electivity index",prepanel = NULL,??????????? panel= function (x, y) {??????????? panel.abline(v=0)??????????? panel.xyplot(x,y, pch = 16, col = "black")??????????? panel.segments(botany$lower,as.numeric(y),??????????? botany$upper,as.numeric(y), lty = 1, col = "black")} ? Thank you!St?phanie ?? [[alternative HTML version deleted]]
You seem to have posted in HTML and the post is close to unreadable. Also you did not include any data, as far as I can see. Please supply some sample dataand code. The easiest way to supply data is to se the dput() function. Example with your file named "testfile": dput(testfile) Then copy the output and pasteinto your emal. Fr large data sets, you can just supply a representative sampl. Usually, dput(head(testfile, 100)) will be sufficient. You might also find https://github.com/hadley/devtools/wiki/Reproducibility and http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example useful John Kane Kingston ON Canada> -----Original Message----- > From: r-help at r-project.org > Sent: Sat, 29 Nov 2014 21:59:14 +0000 (UTC) > To: r-help at r-project.org > Subject: [R] Remove the border/frame in a dotplot() > > Dear listmembersI wouldlike to remove in a dotplot() the border/frame > from the figure and only keepthe x- and y-axis. I can?t find a way to do > this. bty="n" does notwork. Can somebody help? I include the r coding for > my figure below.?dotplot(plant_species ~ mean, data > =botany,????????????aspect= 1.5, > scales=list(x=list(tck=c(-1,0)),y = list(tck=c(-1,0))),??????????? ylab> "Plant species",??????????? xlim= c(-1.1, 1.1),??????????? xlab> "Electivity index",prepanel = NULL,??????????? panel= function (x, y) > {??????????? panel.abline(v=0)??????????? panel.xyplot(x,y, pch = 16, col > = "black") > panel.segments(botany$lower,as.numeric(y), > botany$upper,as.numeric(y), lty = 1, col = "black")} > > Thank you!St?phanie > > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.____________________________________________________________ FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!
st?phanie, I believe you need all of this. Look at it with a good editor and in a monowidth font such as courier to see the structure. Rich library(lattice) library(latticeExtra) dotplot(~ 1:10, par.settings=list( axis.line=list(col="transparent"), clip=list(panel=FALSE))) + layer({panel.axis(side="bottom", line.col="black", outside=TRUE); panel.abline(h=current.panel.limits()$ylim[1], v=current.panel.limits()$xlim[1])}) On Sat, Nov 29, 2014 at 4:59 PM, st?phanie braun <r-help at r-project.org> wrote:> Dear listmembersI wouldlike to remove in a dotplot() the border/frame from the figure and only keepthe x- and y-axis. I can?t find a way to do this. bty="n" does notwork. Can somebody help? I include the r coding for my figure below. dotplot(plant_species ~ mean, data =botany, aspect= 1.5, scales=list(x=list(tck=c(-1,0)),y = list(tck=c(-1,0))), ylab= "Plant species", xlim= c(-1.1, 1.1), xlab= "Electivity index",prepanel = NULL, panel= function (x, y) { panel.abline(v=0) panel.xyplot(x,y, pch = 16, col = "black") panel.segments(botany$lower,as.numeric(y), botany$upper,as.numeric(y), lty = 1, col = "black")} > > Thank you!St?phanie > > > [[alternative HTML version deleted]] > > ______________________________________________ > 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 See also https://stat.ethz.ch/pipermail/r-help/2007-September/140098.html This may do library(grid) dotplot(~ 1:10, scales = list(col = "black", tck = c(1, 0)), par.settings = list(axis.line = list(col = "transparent")), axis = function(side, ...) { if (side == "left") grid.lines(x = c(0, 0), y = c(0, 1), default.units = "npc") else if (side == "bottom") grid.lines(x = c(0, 1), y = c(0, 0), default.units = "npc") axis.default(side = side, ...) }) Duncan Duncan Mackay Department of Agronomy and Soil Science University of New England Armidale NSW 2351 Email: home: mackay at northnet.com.au -----Original Message----- From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Richard M. Heiberger Sent: Monday, 1 December 2014 03:01 To: st?phanie braun Cc: r-help at r-project.org Subject: Re: [R] Remove the border/frame in a dotplot() st?phanie, I believe you need all of this. Look at it with a good editor and in a monowidth font such as courier to see the structure. Rich library(lattice) library(latticeExtra) dotplot(~ 1:10, par.settings=list( axis.line=list(col="transparent"), clip=list(panel=FALSE))) + layer({panel.axis(side="bottom", line.col="black", outside=TRUE); panel.abline(h=current.panel.limits()$ylim[1], v=current.panel.limits()$xlim[1])}) On Sat, Nov 29, 2014 at 4:59 PM, st?phanie braun <r-help at r-project.org> wrote:> Dear listmembersI wouldlike to remove in a dotplot() the border/frame from the figure and only keepthe x- and y-axis. I can?t find a way to do this. bty="n" does notwork. Can somebody help? I include the r coding for my figure below. dotplot(plant_species ~ mean, data =botany, aspect= 1.5, scales=list(x=list(tck=c(-1,0)),y = list(tck=c(-1,0))), ylab= "Plant species", xlim= c(-1.1, 1.1), xlab= "Electivity index",prepanel = NULL, panel= function (x, y) { panel.abline(v=0) panel.xyplot(x,y, pch = 16, col = "black") panel.segments(botany$lower,as.numeric(y), botany$upper,as.numeric(y), lty = 1, col = "black")} > > Thank you!St?phanie > > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.______________________________________________ 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.