similar to: change layout of legend

Displaying 20 results from an estimated 20000 matches similar to: "change layout of legend"

2007 May 15
1
legend with mixed boxes and lines (not both)
Hi, I seem to be unable to get a mixed legend that has lines *or* polygons (not both). For example: ppi <- seq(0,2*pi,length.out=21)[-21] frame() plot.window(ylim=c(-5,5),xlim=c(-5,5),asp=1) polygon(cos(ppi)*4+rnorm(20,sd=.2),sin(ppi)*4+rnorm(20,sd=.2), col="green",border=FALSE) polygon(cos(ppi)*2+rnorm(20,sd=.1),sin(ppi)*2+rnorm(20,sd=.1), col="blue",border=FALSE)
2017 Mar 24
2
Error in documentation for ?legend
To whom it may concern: The help page for ?legend refers to a `title.cex` parameter, which suggests that the function has such a parameter. As far as I can tell, though, it doesn't; here's an example: > plot(1,1) > legend("topright",pch=1, legend="something", title="my legend", title.cex=2) Error in legend("topright", pch = 1, legend =
2011 Apr 29
3
Change the text size of the title in a legend of a R plot.
Hello, Is it possible to change the text size of the title in a legend of a R plot? I tried to directly change the title.cex argument but it seems not to work. Trying : Horizo <- c(1,2,6,10,20) legtext <- paste(Horizo,sep="") legend("topleft", legend=legtext,col=col,text.col=col,lwd=lwd, lty=lty,cex=1.1,ncol=3,title = "Horizons",title.col
2017 Mar 25
2
Error in documentation for ?legend
Right, that's my point. The help page mentions a `title.cex`, like I said; saying that `cex` sets the default `title.cex` sure implies to me (and presumably to the other people whose discussion I linked) that a `title.cex` parameter exists. Since no such parameter exists, this bit in the documentation is misleading (suggesting that there is a `title.cex` parameter which can be set, when there
2011 Aug 21
2
Increase the size of the boxes but not the text in a legend
HI there, I want to add a legend to a plot using the density and angle argument, so patterns with lines in different angles are used in the plot and should be referred to. When I use default settings, the filled boxes are too small. With the cex argument I can enlarge the whole legend, but then the text gets too big. How could I just increase the size of the single boxes and not the text. I
2011 Jul 10
3
change legend character size in image.plot
I'm using the image.plot() function (fields package), but I want to enlarge the characters of the legend (as they are too small to be read in a combined figure), but there is no way I can find a command to do this. I can enlarge the legend bar (with legend.witdh), axis character size (cex.axis) or the total legend size (legend.shrink), but not the character size of the legend characters
2010 Dec 01
3
Question regarding legend look
Hi everyone. I have a quick question regarding the look of my legend in my plot. As you can see in the next figure, I have 3 series. http://r.789695.n4.nabble.com/file/n3067466/legend.png However, I find rather difficult to differentiate the series 1 and 3 according to their line type (lty). I would like to know if it was possible to make the line type in the legend to appear more clearly.
2006 Oct 26
2
distance between legend title and legend box
Hi, I've looked at the parameters available for the legend function and cannot find a way to change the distance between the top of the box surrounding a legend and the legend's title. I have a math expression that raises the height of my title. If you don't mind the non-sensical title I give to the legend for this plot (Figure 3.20 in R Graphics): with(iris,
2010 Aug 30
3
Putting legend *outside* plotting area
Is there a simple way to put a legend outside the plot area for a simple plot? I found... (at http://www.harding.edu/fmccown/R/) # Expand right side of clipping rect to make room for the legend *par(xpd=T, mar=par()$mar+c(0,0,0,4))* # Graph autos (transposing the matrix) using heat colors, # put 10% of the space between each bar, and make labels # smaller with horizontal y-axis labels
2009 Dec 18
2
Legend for two plots
Dear R users, I am new to R and I couldn't figure out how to solve the following problem: I am trying to put a legend below two plots using the code below. The legend appears in the second plot, but I want the legend to appear below the two plots in the center of the total chart. At the moment the graphic looks like this: http://i48.tinypic.com/2h2fvhf.jpg [code] layout(matrix(1:2, nrow=1))
2006 May 10
2
Legend titles in log plots broken? (ver. 2.2.1)
Legend titles work in linear plots: curve(1/x, xlim = c(0, 1)) legend(x = 'topright', inset = 0.04, legend = '1/x', lty = 1, title = 'Legend Title') But when you change to a log plot on either dimension things get screwy: curve(1/x, xlim = c(0, 1), log = 'y') legend(x = 'topright', inset = 0.04, legend = '1/x', lty = 1,
2011 Jun 14
1
xyplot Legend Title and Position
Dear R Community, I'm using xyplot in Lattice with a legend and a title on the legend. The title on legend is being cut off, as can be seen by running the code below. The legend is on the right, but I would like to get to the top right of the graphics window. Is there a way to get the legend title to display correctly and move the whole legend up the the top right? Thanks, Justin ### R
2008 Dec 02
1
legend idea for latticeExtra
Dear list, I've written a small utility function to add arbitrary legend(s) to a lattice graph (or a combination of them), much like the legend function of base graphics. I though perhaps it could be useful to someone else, or improved by suggestions. I understand this goes against the lattice paradigm somewhat, in that you short-cut the link between group variables and the
2006 Apr 10
2
Legend in the outer margin
Dear Rs I have a 3x3 multiple plot. I would like to have a overall legend in the outer right margin. From the help archive, I found that it can be done by setting par(xpd=NA). However, I couldn't find the correct values for x and y co-ordinates for the legend. Please find the code snippet below: par(mfrow=c(3,3), mar=c(4,4,0.9,0.5), oma=c(1,2,2,4),cex.main=1.1)
2006 Mar 02
2
'...' passed to both plot() and legend()
Dear R-devels, I'd like to create a plot method for a class of objects that passes the '...' argument to both plot() and legend(), e.g., x <- list(data = rnorm(1000)) class(x) <- "foo" plot.foo <- function(x, legend = FALSE, cx = "topright", cy = NULL, ...){ dx <- sort(x$data) plot(dx, dnorm(dx), type = "l", ...) if (legend)
1999 Sep 11
1
legend(): adjust space between symbol and tex
Hello, I'd like to ask, how to adjust the space between symbol/line and text in a legend. My legend() is build like that legend(xmax-netzdiff/11, # shouldn't matter here ifelse(ydiff>=0, # ymin-6.5*(netzdiff/11), # ymax-netzdiff/11), # c("stehender Stamm","Windwurf",
2009 Mar 24
2
Legend containing maths symbol and values of variables
I need to have the maths symbol for >= in the legend, and to substitute threshold variable with its value. Somehow, various attempts weren't successful. Please help. threshold <- 0.5 plot(NA, xlab="", ylab="", main="", axes=F, xlim=c(0,1), ylim=c(0,1), xaxs="i", yaxs="i") legend(x=0, y=1, fill=c("orange", "white",
2011 Jul 18
2
line jump in plot legend title
Hello, In order to reduce the width of my legend in a plot I introduced line jumps in the title. Here's the problem; the legend box hasn't adapted accordingly and part of the title is printed out of the frame. See the example below: plot(1:10) legend("bottomright", bg="white", fill=c(7,8,12,13,19),
2009 Aug 27
1
Wishlist: specify the border color of boxes in legend() (PR#13913)
I could not find a way to specify the border color of the boxes drawn in a legend, so that the legend can match exactly the colors of the actual plot (e.g. in the case of two superimposed histograms which have different shading and different borders). Indeed, the legend function seems to hard code the color "black" for the borders in this call: rect2(left = xt, top = yt +
2008 May 14
1
lw in legend also changes thickness of characters in the legend??
Here's a simple example: x <- 1:5 plot(x,x^2) lines(x,x^2) points(x,x,cex=2) lines(x,x,lw=3) legend("topleft",legend=c("y=x^2","y=x"),pch=1,pt.cex=1:2,lw=c(1,3)) The thickness of the circles in the legend changes with lw. If you change the lw argument in legend to lw=c(1,1) then the thickness of the circles goes back to normal. How can I make the above