Adding greek character to axis title
If you're using plotmath{grDevices}
, the main help page (plotmath) contains an example of what you appear to want:
xlab = expression(paste("Phase Angle ", phi))
or for your case, I guess:
ylab = expression(paste("Diameter of aperture ( ", mu, " )"))
Does this work for you?
Adding greek character and asterisk (*) to axis title
What about using ggplot2
instead of base R. You can then use latex2exp::TeX
to use (some) LaTeX expressions in the axes labels.
set.seed(2018)
x = rnorm(1000)
library(ggplot2)
library(latex2exp)
ggplot(data.frame(x = x), aes(x)) +
geom_histogram(bins = 100) +
theme_minimal() +
xlab(TeX("$\\widehat{\\phi^*}$"))
You need to escape the backslashes with an extra backslash and wrap math expressions inside $
delimiters (just as in regular LaTeX inline math). I used \widehat{}
, but you can also use hat{}
instead.
Adding greek characters with variables to axis title
I'd try using a plotmath list
call:
plot(1,1, main= bquote(list( alpha == .(alpha[1]) , beta == .(beta[1])) ) )
How to use Greek symbols in ggplot2?
Here is a link to an excellent wiki that explains how to put greek symbols in ggplot2. In summary, here is what you do to obtain greek symbols
- Text Labels: Use
parse = T
insidegeom_text
orannotate
. - Axis Labels: Use
expression(alpha)
to get greek alpha. - Facet Labels: Use
labeller = label_parsed
insidefacet
. - Legend Labels: Use
bquote(alpha == .(value))
in legend label.
You can see detailed usage of these options in the link
EDIT. The objective of using greek symbols along the tick marks can be achieved as follows
require(ggplot2);
data(tips);
p0 = qplot(sex, data = tips, geom = 'bar');
p1 = p0 + scale_x_discrete(labels = c('Female' = expression(alpha),
'Male' = expression(beta)));
print(p1);
For complete documentation on the various symbols that are available when doing this and how to use them, see ?plotmath
.
Superscript, subscript, and greek symbol all in one axis title in ggplot2
Try this:
qplot(0, 0) + xlab(~ paste("Plant ", delta ^ 34, "S ", ("%"[0])))
How to add a hat to a greek letter in a graph label in excel 2013
You can use Unicode on fonts that support it. You want 'GREEK SMALL LETTER XI' (U+03BE) + 'COMBINING CIRCUMFLEX ACCENT' (U+0302) to form ξ̂.
To enter these codes on various platforms, consult this entry in Wikipedia. In Office, you should be able to enter "3BE" then press Alt-x, then enter "302" and press Alt-x again to get the combined character.
Adding greek symbol and superscript to ggplot axis text (tickmarks)
You need to add an asterisk to escape the superscript:
df2[which(df2$name == "d18O"),]$name <- "delta^18*O"
Related Topics
Using Stargazer with Rstudio and Knitr
Conditional Coloring of Cells in Table
Legend Placement, Ggplot, Relative to Plotting Region
Joining Aggregated Values Back to the Original Data Frame
Using Substitute to Get Argument Name
Why Does As.Factor Return a Character When Used Inside Apply
Displaying a Greater Than or Equal Sign
Extract Names of Objects from List
Get All Diagonal Vectors from Matrix
How to Make Gradient Color Filled Timeseries Plot in R
Assigning Dates to Fiscal Year
How to Change the Color Value of Just One Value in Ggplot2's Scale_Fill_Brewer
Splitting a String into New Rows in R
Aggregate() Puts Multiple Output Columns in a Matrix Instead