2

I need to add a special character to a plot in R. The character that I need to add is the letter 'o' with a dash over it (ō). How can I do this? If I wanted to add the character μ to my plot (as in this question), I can type "mu". But what do I type for o-bar (I'm wishing for a repository of special characters in R)?

Community
  • 1
  • 1
Nigel Stackhouse
  • 354
  • 2
  • 15
  • 3
    Possible duplicate of [special characters and superscripts R plot axis titles](http://stackoverflow.com/questions/15736370/special-characters-and-superscripts-r-plot-axis-titles) – jeremycg Nov 23 '15 at 19:21

1 Answers1

4

Try combining expression with the bar function

plot(1:5,main = expression("This is your Special Character -" ~ bar(o)))

Plot 1

Just to add a little more information, R actually lets you do a lot of cool stuff with plotting symbols. check out ?bar.

Just some examples you can try by replacing your argument in main, xlab or ylab:

main = expression(sum(x[i], i==1, n))

main = expression(integral(f(x)*dx, a, b))

s_scolary
  • 1,361
  • 10
  • 21