[R] Add interpunct (dot) symbol to axis label?

David Winsemius dwinsemius at comcast.net
Thu Aug 9 22:40:29 CEST 2012


On Aug 8, 2012, at 6:21 PM, Hillary Ward wrote:

> I'm having problems creating an axis label for a plot.
>
> y_label = expression(paste(plain('CPUE
> '),plain('(fish'),plain('x'),plain('h'^{-1}),plain(')')))
>
> I'd like to replace the "x" with an interpunct symbol (dot). Any
> suggestions how to do this?

I see you have seen other efforts in this direction, but thought I  
would throw in something different. I think the 'interpunct' symbol is  
already include in plotmath as '%.%'

.... and I cannot resist attempting to greatly simplify that complex  
expression. Most uses of the plotmath 'paste' function I see in other  
postings are both redundant and obfuscatory (at least I think that  
should be a word). And parentheses behave as expected .... And you do  
not need to use quotes around anything that is not a plotmath  
function.  I think this does the same construction and is MUCH easier  
to read:

   ylab = expression( CPUE(fish %.% h^{-1}) )

-- 

David Winsemius, MD
Alameda, CA, USA



More information about the R-help mailing list