I've looked on SO and haven't found this exact issue or solution for this. I am trying to label my x-axis: [NO3 + NO2] (mu mol L ^-1); where the 3 and 2 are subscripts, the mu shows as the symbol and the -1 is a superscript.
I think my main issue right now is that my x-axis title has to start with the "[" bracket. I am using ggplot.
I am able to get the first part "[NO3" but haven't been able to add anything past the subscripted 3:
xlab(bquote('[NO'* "" [3]))
Can't seem to add anything after the 3 without getting errors
I've tried the following:
xlab(bquote('[NO'* "" [3] '+ NO' * "" [2] '] ('))
Error: unexpected string constant in:
" #xlab(bquote([NO[3] + NO [2]]))
xlab(bquote('[NO'* "" [3] '+ NO'"
and
xlab(bquote('[NO'* "" [3]~ '+ NO' * "" [2] '] ('))
Error: unexpected string constant in:
" #xlab(bquote([NO[3] + NO [2]]))
xlab(bquote('[NO'* "" [3]~ '+ NO' * "" [2] '] ('"
and
xlab(bquote('[NO'* "" [3]~ ~'+ NO' * "" [2] '] ('))
Error: unexpected string constant in:
" #xlab(bquote([NO[3] + NO [2]]))
xlab(bquote('[NO'* "" [3]~ ~'+ NO' * "" [2] '] ('"
and
xlab(bquote('[NO'* "" [3]'+ NO' * "" [2] '] ('))
Error: unexpected string constant in:
" #xlab(bquote([NO[3] + NO [2]]))
xlab(bquote('[NO'* "" [3]'+ NO'"
and
xlab(bquote('[NO'* "" [3]}~'+ NO' * "" [2] '] ('))
Error: unexpected '}' in:
" #xlab(bquote([NO[3] + NO [2]]))
xlab(bquote('[NO'* "" [3]}"
and
xlab(bquote('[NO'* "" [3]~'+ NO' * "" [2] '] ('))
Error: unexpected string constant in:
" #xlab(bquote([NO[3] + NO [2]]))
xlab(bquote('[NO'* "" [3]~'+ NO' * "" [2] '] ('"
and variations of...
labs(x = expression([NO[3]]))
Nothing seems to work... Any suggestions?
Additionally, any way of splitting y-axis into three lines? I was able to get what I want for y-axis title, which I have as:
ylab(bquote('\u03b1 '^{"chla"}~'\n(g C g chla'^{"-1"}~'hr'^{"-1"}~'/ ' *mu~ 'mol quanta' ~m^{"-2"}~'s'^{"-1"}~')'))
Is it possible to split this into 3 lines (the \n doesn't seem to do anything here)?
Thank you.