Displaying 20 results from an estimated 10000 matches similar to: "color of math annotation in legend"
2009 Dec 11
1
Array of legend text with math symbols from predefined variables
Hello,
I am trying to include legend text with math symbols from a predefined
character variable that is read in from a file.
?
If there is only one line of text in the legend, the following, although
cumbersome, works for me:
? > LegendText = " 'U' [infinity], '=10 m/s' "?? # (read in from a file)
??> LegendName = paste("bquote(paste(",LegendText,
2012 Jul 26
3
Remove rows that have repeated items in a particular column
Dear R Users,
I apology for not being able to provide an adequately informative subject.
Let me describe my problem with an example.
For a matrix
* (mat <- matrix(c(1,1,2,2,2,3,3, 5,9,1,3,7,4,8), ncol = 2))*
my desired output is
* (desired <- matrix(c(1,2,3, 5,1,4), ncol = 2))*
That is, the first column is numerically grouped and only the first item in
each group is wanted. The
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
2010 Mar 16
1
labels gone
Dear R users:
I am drawing a graph with the following code:
Tau<-seq(0.05,0.95,0.05);
Pi <- seq(0.19,0.01,-0.01);
par(cex.axis=0.8,ps=9,mar=c(1.5,1,0.5,1), oma=c(1,1,0.2,1) ,tck=-0.01);
plot(Tau,Pi, type='l', xlab="Tau",ylab="Pi",col=4);
I want to make the graph take as little space as possible. Here I run into
two problems. One is that the labels are gone, the
2010 Sep 29
1
sample exponential r.v. by MCMC
Dear R users,
I am leaning MCMC sampling, and have a problem while trying to sample
exponential r.v.'s via the following code:
samp <- MCMCmetrop1R(dexp, theta.init=1, rate=2,
mcmc=5000, burnin=500,
thin=10, verbose=500, logfun=FALSE)
I tried other distribtions such as Normal, Gamma with shape>1, it works
perfectly fine. Can someon
2011 Jul 13
1
Smart legend ???
Hi, all:
Is there an automatic smart legend for R?
Since my R code is running in a row, which will produce a bunch of R plots
in a single run, some of the produced plots are really "ridiculous".
Because my legend is fixed to "topleft", sometimes, which occludes the key
parts of the figure/plots, but most of the time, the legend works just fine.
I'm wondering is there a
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
2011 Feb 04
1
Can an xyplot() plus legend be saved as an Enhanced Windows Metafile (EMF)?
I am trying to save some graphical output including a legend in the
Windows Enhanced Metafile (EMF) format.
This fails when xyplot() is used rather than plot().
Here is a simple example:
require(lattice)
a <- c(1:10)
b <- c(2,4,5,2,3,5,7,8,9,5)
# Output can be saved (or copied to the clipboard) as a Windows EMF image
file
# from the Graphics Device output window.
plot(a , b)
2006 Oct 13
3
Barplot legend position
Dear useRs,
I'm trying to create a barplot like so:
x=matrix(1:10,2,5)
barplot(x,leg=c("left","right"),besid=T)
The legend is placed in default position topright, however the data are
plotted there too. I tried controlling the legend position by adding
x="topleft" but this results in an error that x matches multiple formal
arguments.
Leaving out the legend
2011 Feb 10
1
Add different types of legend: line and points
Hello,
I plot box plot, and add a point to the box indicating mean. I also add some
range to the box width. I want to add legend for both the range (line) and
mean (point). However, I cannot add line legend and point legend together.
The code looks like the following.
(1) First, I tried the following code, however, it plot a line across the
point legend("*").
boxplot(count ~ spray,
2009 Nov 30
1
Continuous legend colors
Dear List,
I am trying to get a basic plot to show a continuous range of fill colors. It is probably easiest to demonstrate. I would like a legend like in the following example:
Satellite.Palette <-colorRampPalette(c("blue3","cyan","aquamarine","yellow","orange","red"))
require(fields)
image.plot(volcano, col = Satellite.Palette
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 Feb 04
3
Legend symbol?
Hello,
I am creating a plot/image using different data and a couple fit lines
(see attached image). In the legend, I want the Default and Exponential
symbol to be a line. I am using the pch command, I tried to use "-" to
represent a line but does not work so I currently have set as a "1".
Any thoughts or suggestions would be greatly appreciated.
Below are the commands
2004 Dec 02
3
Wishlist: simple legend options (PR#7400)
Full_Name: Elizabeth Purdom
Version: 1.9.1
OS: Windows XP
Submission from: (NULL) (171.64.102.199)
It would be nice if legend had the option of some default locations you could
choose instead of entering specific coordinates, like "topleft",
"topright","topcenter", etc. based on par("usr") coordinates. I know I've wanted
it so often I've made my
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 =
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)
2009 Sep 25
2
Letra cursiva en legend()
Buenas tardes para todos,
Consideren la siguiente gráfica:
# Algunos datos
set.seed(123)
D <- matrix(rnorm(100), ncol = 2)
# Gráfico
matplot(D, type = ''l'', lty = 1, col = c(3,4),
las = 1, xlab = "Observación", ylab = ''Valores'')
# Leyenda
legend(''topleft'', c(''A1'',''A2''), text.col =
2008 Oct 23
3
xy.coords in text
Hello,
I want to add text annotation about correlation on "pairs" plots. I
found that I could pass a function to the "panel" argument of pairs :
panel.annot <- function(x, y, ...) {
points(x, y, ...)
c <- cor.test(x, y)
legend("topleft", legend=substitute(rho == r, list(r=sprintf("%.2f",
c$estimate))), bty="n")
}
And then :
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))