Displaying 20 results from an estimated 10000 matches similar to: ": bquote inside legend()"
2007 Sep 25
3
Legend
I have following syntax for putting a legend :
legend("bottom", fill=c("red","blue"), legend=expression(p==0.30, p==0.50), bty="n")
However what I want is that : the value "0.30" should be a value of a variable instead of a constant, so that I can put the name of this variable and in legend it's value will be displayed. Can anyone tell me how
2009 Nov 28
1
Plot-region not complete
Hello there,
after I solved many problems in the last days with R I wanted to
complete my plot. I used
ylab=expression(paste("log(",mu,"/",cm^2,"/VS)"))
to have greek symbols and to change cm^2 to cm?. Also cm^-3 I have in
another plot, but it cuts my ^2 to _ in the y-axis.
here is the code and I attach the plot:
jpeg(file="Tabh2.jpg",quality=100)
2009 Nov 02
2
superscript troubles
I know that this has been revisited over and over, yet I cannot figure out
how to solve this case of superscript troubles...
I would like the 2 in r2 to be superscript, yet I am pasting text before and
after it. I have tried several variations but have not solved this yet, any
suggestions?
legend (bty =
2009 Aug 06
1
adding color bar to a graph
Hi everybody,
I am wondering how i can add a "stretch" color bar / legend to a graph that uses colorBrewer to define the colors in it. I will try to explain my graph, but i also uploaded it at: ftp://ftpext.usgs.gov/pub/er/fl/st.petersburg/Monica_pal/
The file is: robcor_training_pca.pdf - i will also attach this file in case some people accept attachments.
So i took apart the
2004 Mar 25
1
Error in 'legend' help?
Dear all,
maybe I have misunderstood something but to me it seems like a minor error
in the help for
?legend
for the argument 'bg'. There it says:
bg: the background color for the legend box. (Note that this is
only used if 'bty = "n"'.)
I think, however, that it should be changed to:
bg: the background color for the legend box. (Note that this
2011 Jul 25
1
Creating png of layered legend
I am trying to create a plot that has multiple plot characters for
each point (e.g. a point within a triangle, a triangle within a
square, etc). The workaround I have found to do this is by plotting
twice, as in this example:
x <- c(1.1, 2.3, 4.6)
y <- c(2.0, 1.6, 3.2)
plot(x, y)
points(x,y, pch=20, col="red", cex=0.5)
This works, but perhaps there is a better way to do it in one
2007 Jun 08
2
legend + expression
Dear all;
A simple? question.
I'm having a problem with a math expression in the legend of a plot
and I haven't found the way to get this to work, so any help will be
appreciate. Basically I want to include in the plot is the R-squared
and its numerical value, so I tried this:
R2c<-0.82879 # R-squared of calibration model
plot(1:10,1:10)
legend("topleft",
2010 Jul 11
1
difficulty with R expressions in text/legend
hi, i'm trying to prepend some plain (i.e. unevalutated) text to a
typographically evaluated R expression in a legend(...) call.
here's a working legend(...) call that is close to what i'd like
(where x and y are returned from an lm(...) call):
legend("topleft", legend = c(bquote(R^2 == .(summary(x)$r.squared)),
bquote(R^2 == .(summary(y)$r.squared))), fill =
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 +
2003 Dec 12
1
legend() graphics output bug (PR#5725)
Full_Name: Daniel Gasser
Version: 1.8.1
OS: Win XP
Submission from: (NULL) (130.60.20.92)
The legend()-Function shows a different behaviour than it did in Version 1.6.1.
It plots a black box left of the legend lines on each legend row. In 1.6.1 there
was just the line in appropriate color for each row in the legend (i was using
exactly the same legend statement and same plot function).
My legend
2005 Apr 30
1
legend(): how to put variable in subscript?
Dear List,
I would like to plot a simple legend with two math expressions, e.g.
plot(0)
legend(1, 0.5, expression(sigma[i], sigma[j]))
The difficulty is that i and j should be variables rather than strings "i" and
"j". In other words I'd like to do something like:
i = "A"
j = "B"
legend(1, 0.5, expression(sigma[i], sigma[j]))
and have "A"
2010 Feb 19
1
"Legend" question
Hi,
I want to get a histogram with the legend for my data. I drew a normal density curve and kernel density curve in the histogram, and I also label mean and median in the X axis. From the code, I got two legend: One shows "Normal Density" and "Kernel Density" and their corresponding lines, the other shows "Mean = value" and "Median = value" and their
2010 Apr 26
5
How to make legend with line+ character
Dear all,
I have a multiline plot with each line labeled with a different letter.
But I'm not able to make the legend display the same kind of pattern
'-a-', instead the letter is overwritten by the line. A simpler legend
with only the letter is not very visible and the pt.bg does nothing with
letters. Any idea?
plot(1:10,10:1,lty=1,type='b', lwd=2,pch='a')
2011 Jul 27
2
Creating a flat legend 'grob' for lattice xyplot
Hi,
I want my xyplot legend to be flat, not tall, and there seems to be no way
for xyplot's auto.key and key elements to do this: I tried many, many
permutations of what I could find in the archives and reading the
documentation. If there there's a way to make it flat, please tell me what
the magic incantation is.
Here's a simple example of what I like to see. The xyplot will be a
2012 Jun 08
2
changing font to italic for one entry in legend()
Hello,
I need to change the font for one of the items (C. elegans) in my
legend to italic. Can someone suggest how to accomplish this?
legend('bottomright', bty='n', c('C. elegans range', 'Study area'),
cex=0.8, fill=c('light gray', 'white'), border=c('black','black'))
I tried using lab.font=c(1,3) but R ignored and did not write
2007 Aug 12
2
Legend on graph
Hi,
I have a problem when I want to put a legend on the graph.
I do:
legend("topright", names(o), cex=0.9, col=plot_colors,lty=1:5, bty="n")
but the legend is writen into the graph (graphs' top but into the graph),
because I have values on this position. How can I write the legend on top
the graph without the legend writes on graph's values.
Thanks.
[[alternative
2009 Aug 25
3
math symbol + value of a variable in legend.
Hi R users:
I will like to have a legend with math symbols and also with
the value of a variable.
But I cannot obtain both at the same time (symbol + value of a
variable):
Here is a reproducible example:
m1<-5
m2<-12
plot(1:5,1:5,type="n")
legend("topleft",legend=c(paste(expression(mu),"=",m1),expression(paste(mu,"=",m2))),lty=1:2)
Thank you for
2009 Aug 25
3
math symbol + value of a variable in legend.
Hi R users:
I will like to have a legend with math symbols and also with
the value of a variable.
But I cannot obtain both at the same time (symbol + value of a
variable):
Here is a reproducible example:
m1<-5
m2<-12
plot(1:5,1:5,type="n")
legend("topleft",legend=c(paste(expression(mu),"=",m1),expression(paste(mu,"=",m2))),lty=1:2)
Thank you for
2013 May 12
1
How to center a horizontal legend with specified 'text.width'
Hello dear list,
I just cannot figure out how to do this and didn't find a solution for my specific problem.
I want to place a centered horizontal legend between 4 plots. That's no problem.
The problem is: As soon as I specify the "text.width" parameter to separate the two legend entries, the legend is not centered anymore. I thought the 'xjust' parameter would do what
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)