I'm trying to superscript a '-' straight after a subscript 4 in an axis title in ggplot2 using bquote. I'm so close! The following gives me everything EXCEPT a small, superscript - straight after the subscript 4:
qplot(uptake, data = CO2) +
ylab(bquote('Membrane available NH '[4]*'-N ( '*mu*'g' ~ resin^-1* ~ 14~day^-1*')'))
I've tried playing around the ^, for example:
qplot(uptake, data = CO2) +
ylab(bquote('Membrane available NH '[4]*^-'-N ( '*mu*'g' ~ resin^-1* ~ 14~day^-1*')'))
But get error messages such as:
Error: unexpected '^' in "qplot(uptake, data = CO2) +
ylab(bquote('Membrane available NH '[4]*^"
Clearly I'm not expressing the ^ correctly.
Any help would be greatly appreciated.
Many thanks!
I thought what was being requested was an extra space between the subscripted 4 and the superscript minus. Using phantom() is one method. The length of the "space" is the same as the space needed to fit the character value (at 0.67 magnification):
NH[4]^{phantom("A")~"-"}
This is a guess at what you might want. I took out as many quotes as possible and used cdots instead of juxtaposition is some places. Obviously your tastes or those of your editors) may vary:
qplot(uptake, data = CO2) +
ylab(bquote(Membrane~available~NH[4]^{phantom("__")*'-'}-
N *( mu %.% g [ resin]^-1 %.% ~ 14~day^-1)))
If it's suppose to be micrograms then use mu*g~
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With