Displaying 20 results from an estimated 30000 matches similar to: "Paste expression in graph title"
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 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 =
2010 Jan 25
2
Two == expressions in bquote
Hi,
I want to put text on a plot containing something like: a = b^2 = <squared numeric value of b> using bquote.
Example:
mu = 5
plot(1:10,1:10)
text(2,8, bquote(delta == mu^2)) # This works
text(2.5,8, bquote(phantom(0) == .(mu^2))) # but is unpredictable
text(2,8, bquote(delta == mu^2 == .(mu^2))) # This doesn't work
The last text function returns the error:
2011 Feb 01
2
superscript
Hi there,
How can I superscript the "2" of "r2 =..." in the legend below?
legend(210, 110, paste("r2 = ",
format(summary(regression)$adj.r.squared,digits=3), sep=""))
I usually use "expression(paste(...", but it won't work this time because
"format(summary(..." needs to be evaluated.
Thanks in advance!
--
View this message in
2011 Jun 02
2
plotmath: paste string and expression [from a vector of expressions]
Dear all,
I have a vector of expressions and would like to "paste" some string to it before using it in a plot:
vars <- vector("expression", 2)
vars[1] <- expression(alpha)
vars[2] <- expression(beta)
plot(0, 0, main=substitute(bold("Foo" ~~ VAR), list(VAR=vars[2]) ))
Although I tried hard, I just can't figure out how to solve this. The title should be
2006 Mar 06
3
how to make plotmath expression work together with paste
Recent questions about using plotmath have renewed my interest in this question
I want to have expressions take values of variables from the
environment. I am able to use expressions, and I am able to use paste
to put text and values of variables into
plots. But the two things just won't work together.
Here is some example code that shows what I mean.
plot(NA,xlim=c(0,100),ylim=c(0,100))
2012 May 22
1
Adding Text to a Plot
Hi, all!
I'm pretty sure I'm missing something about this.
Is there a smart way of typping hat(R)^2 and it's value from a linear
regression?
I've just found this tricky one:
# Sample data
x <- sample(1:100,10)
y <- 2+3*x+rnorm(10)
# Run the regression
lm1 <- lm(y~x)
# Plotting
plot(x,y, main="Linear Regression", col="red")
2011 Feb 20
3
Partial italic in graph titles when looping
Dear all,
I have a rather complicated problem. I am trying to loop through making graphs,
so that the graph-making process is fully automated. For each graph, I'd like to
make sure the corresponding title is formatted properly. The titles will be a
combination of a gene name and numerical position within the gene. The gene name
should be italic-bold, whereas the gene position should be
2006 Nov 14
3
Plot title with numeric variables
I am trying to create a plot title in R with substitution by a numeric
variable (Figure number N) within the text which is bold and has a
subcripted part as well. Here is what I have:
title <- expression(bold(paste("Figure ", N, ": Plot ", C[max], " versus
CrCL")))
plot(1, main="") # Simple plot for testing
N <- 5
mtext(title, line=3, font=2,
2010 Aug 28
4
expression() and plot title
What I want to do is put the arguments I supply to a function into the
title of a plot
Say I'm calling func.1
func.1(a=4,b=4)
plot(....,..., title("a=4, b=4"))
If I'm calling func.1 with different arguments, I want the plot title to
reflect that.
A small detail is that func.1 might have an argument with a default like
c=a+b. I tried using expression but couldn't get it to
2010 Jul 22
1
, how to express bar(zeta) in main title in boxplot
Hi everyone, I am plotting a boxplot with main title as main =
bquote(paste(.(ts.ind[s]), ": ", bar(zeta), " Boxplot from 2001 to 2009", sep = "")) but it doesn't work. The program said they cannot find the function "bar". Does anyone know how to do it correctly? Thanks.
tin
[[alternative HTML version deleted]]
2010 Oct 22
2
superscript characters in title with '+'
Hi,
How can I get the '2+' into superscript in the following title:
'[Ca2+]i onsets'
I tried the command below, but it doesn't work. What am I missing?
hist(X, main=expression(([Ca*]i^2+) 'onsets'), xlab = 'sec')
--
View this message in context: http://r.789695.n4.nabble.com/superscript-characters-in-title-with-tp3006981p3006981.html
Sent from the R
2006 Jul 30
3
main= bquote(paste("Results for ", beta, "3", ==.(b1)))) doesn't work.
Hi,
I need to plot the beta as the symbol, followed by the index 3 as the title of a graph.
This code works> main= bquote(paste("Results for ", beta ==.(b1))
but I also need the index 3.
I tried (simplified):
>plot(x,y, main= bquote(paste("Results for ", beta, "3", ==.(b1))))
and a few other versions, but I can not get it to run properly.
Any help would
2012 Sep 17
4
Using paste to create and evaluate a variable expression
Is it possible to use "paste" to write out an expression and evaluate it?
Suppose I want to add two vectors X1 and X2, defined as follows:
X1 <- 1:6
X2 <- 6:1
If I write the following it looks like what I want but is a character:
noquote(paste(paste("X", 1, sep = ""), paste("X", 2, sep = ""), sep = "+"))
Is there a way to tell R
2012 Aug 16
4
Variables and greek letters in a plot title
Hello
This is a problem I encountered repeatedly and I found no answer that made
me really happy. I hope it is not too trivial.
I would like to give the concentration of a substance in a plot title:
5 ug/ml substance
the '5' would be a variable and the ug should be micrograms (with greek
letter mu). It is the mu that causes the problems for me. I failed using
various combinations of
2009 Sep 02
2
combining grid.text, expression and variables
Dear R-users,
I am trying to use the grid.text and expression functions to display
several character strings and plotmath text on a viewport. Some strings
can include a variable portion (PI.limits in the following example),
which I thought could be implemented by combining the bquote and the
expression functions. Unfortunately, my expressions do not seem to be
evaluated. I would greatly
2011 Mar 31
1
Italicized title from index
Hi all!
I've written a handy script that uses a for loop to allow me to generate a
large number of figures and statistical outputs for a large dataset.
I am using indexing to retrieve a species name for the title of my graphs-
which worked fine. However, I need to italicize these species names.
I originally used the paste function, and had no problems with indexing:
*main=paste("Yield
2009 Aug 11
1
Paste symbol and calculation in plot
I'm trying to annotate a density plot and I would like to have R calculate the
standard deviation and place it in the plot next to the standard deviation symbol
"sigma". I can successfully use the text command to paste "StDev =",round(sd(Data),digits=3))
on the plot. However, I have trouble when I want to replace "StDev" with the Greek
symbol sigma (See code
2011 Feb 08
1
Mixed font type in plot title
Hello useRs,
I'm trying to put italics and regular font into a title and am having
some trouble. The title I would like is " /Q. marilandica/ Volume ".
If I use
main=bquote(italic( "Q. marilandica ", " volume"))
I get just " Q. marilandica " in italics in the title.
If i use
main=bquote(italic( "Q. marilandica ,) volume")
I get "