I want to plot a label that looks like this in ggplot2
: Value is $\sigma$, R^{2} = 0.6
where Value is
is ordinary font, $\sigma$
is a Greek lowercase sigma letter and R^{2} = 0.6
appears as an R
with a superscript 2
followed by equal sign (=
) followed by 0.6
. How can this be used in ggplot factor
s and in arguments to things like xlab,ylab
of R? thanks.
相关问题
- R - Quantstart: Testing Strategy on Multiple Equit
- Using predict with svyglm
- Reshape matrix by rows
- Extract P-Values from Dunnett Test into a Table by
- split data frame into two by column value [duplica
相关文章
- How to convert summary output to a data frame?
- How to plot smoother curves in R
- Paste all possible diagonals of an n*n matrix or d
- ess-rdired: I get this error “no ESS process is as
- How to use doMC under Windows or alternative paral
- dyLimit for limited time in Dygraphs
- Saving state of Shiny app to be restored later
- How to insert pictures into each individual bar in
Somewhat more straightforward than paste() might be:
Generally
paste
and all those paired-quotes are not needed if you use the proper plotmath connectives. Even if you want the text that would otherwise create a Greek letter, all you need to do is enclose it in quotes with either a*
or~
on each side. One trouble with offeringpaste
to newcomers to plotmath expressions is that they then think it is the same aspaste
in the rest of the language.Something like this :
EDIT
Another option is to use
annotate
withparse=T
:EDIT
The
paste
solution may be useful if the constant 0.6 is computed during plotting.