Displaying 20 results from an estimated 20000 matches similar to: "Question regarding legend look"
2011 Nov 24
1
Legend
Hi everyone.
I have a linear regression where I retrieve the R2 like this:
r2 = sprintf('%4.2f %s',(summary(reg1)$r.squared))
In my figure I have a legend where I would like to add that R2 value to the
legend text.
Something like: My text R^2 = r2
legend('topright', inset = .05, title='light ratios', pch = c(21),
c(paste('Green/Red', R^2, '=', r2)),
2013 Dec 02
3
legend position
Hi all.
I'm ploting a raster and I can't find the proper way to move the legend. For example,
r = raster(system.file("external/test.grd", package="raster"))plot(r)
How can I put the legend at the desired position?
Thank in advance,Phil
[[alternative HTML version deleted]]
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 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 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
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,
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))
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
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
2012 Apr 06
4
Legend based on levels of a variable
I have a bivariate plot of axis2 against axis1 (data below). I would like
to use different size, type and color for points in the plot for the point
coming from different region. For some reasons, I cannot get it done. Below
is my code.
col <- rep(c("blue", "red", "darkgreen"), c(16, 16, 16))
## Choose different size of points
cex <- rep(c(1, 1.2, 1), c(16, 16,
2007 Mar 21
2
Detailed legend in mathplot ...
Hello,
Recently, I have asked for a help with building graphs, and I got few
great advices. Now, my appetite is growing :) and I wander how to add
legend for two (or more) lines in following example:
matplot(DAT[, c(3,4)], type="b", ylim=c(0,8), xaxt="n", yaxt="n",
+ pch=c(21,22), col="black", lty=c("dashed","solid"), xlab="",
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
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)
2003 Mar 21
1
barplot legend size
Dear R-people,
are there any way to change the size of legend in barplot? I have
tried various versions of cex, both as par(cex.*= ) and barplot(...,
cex.*= ). So long without success.
Sincerely,
Ott
> version
_
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system i686, linux-gnu
status
major 1
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",
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
2010 Jan 12
1
Multiple symbols per single line in a legend
Hello everybody,
Is it possible to coax legend() into displaying more than one simbol per
line in legend? I have a graph like the one attached to this mail; I would
like to reorganize the legend in such a way that the duplicate text would be
omitted, i.e., the first line would read <square> <triangledown> "increasing
frequency" and the second one would read <circle>
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",
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 +
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