Question: How to write micro symbol in ggplot 2 legend
0
gravatar for Nitin
6.1 years ago by
Nitin150
Germany
Nitin150 wrote:

Hello,

I am trying to plot line plot using ggplot2 in R. I want to use a micro symbol in legend labels. I am using following code

lineplot <- 
  ggplot(meltDat, aes(x = num, y = value, group = variable, color = variable)) + 
  geom_line() + xlab("Time in seconds") + ylab("scattering") + 
  scale_color_manual(
    values=c("darkorange","orange3","orange","steelblue3","royalblue3","steelblue3"),
    breaks=c("CSonly","CS","CS+H+BV","CS+HS+14","CS+HSP+28microM"),
    labels=c("CS only","CS + HS","CS + HSP + B",
             "CS + HS + C bquote (14 muM)","CS + HS + C 7 (28 micro Molar)")) 

Unfortunately, it is not working.

Can anybody suggest some piece of code to do this?

Thanks,

Nit

R • 5.0k views
ADD COMMENTlink modified 6.1 years ago by Devon Ryan98k • written 6.1 years ago by Nitin150
2

Making presentation/publication-ready pictures with R sometimes can be painful (legends/fonts/special characters/...). For many purposes it can be useful to make a pdf-export of your plot and format your plot in a scalable vector graphics editor like Inkscape or Illustrator

ADD REPLYlink written 6.1 years ago by Irsan7.3k
1
gravatar for Devon Ryan
6.1 years ago by
Devon Ryan98k
Freiburg, Germany
Devon Ryan98k wrote:

Your google-fu needs strengthening: https://github.com/hadley/ggplot2/wiki/Plotmath

BTW, the short answer is that you need to use expression().

ADD COMMENTlink modified 6.1 years ago • written 6.1 years ago by Devon Ryan98k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1910 users visited in the last hour
_