Adding Greek Character to Axis Title

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^*}$"))

Sample Image

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

  1. Text Labels: Use parse = T inside geom_text or annotate.
  2. Axis Labels: Use expression(alpha) to get greek alpha.
  3. Facet Labels: Use labeller = label_parsed inside facet.
  4. 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])))

screenshot

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



Leave a reply



Submit