Re: [R] Is there a plotmath symbol \mapsto?

2014-12-12 Thread Prof Brian Ripley

On 12/12/2014 19:40, David Winsemius wrote:


On Dec 12, 2014, at 5:32 AM, Prof Brian Ripley wrote:


The only symbols plotmath has access to are those in the Adobe Symbol encoding. 
 You can display all of those using the example at the bottom of ?points, as 
?plotmath did tell you.  (So it was a rather rich asking for an example.)

It also tells you that on some devices/platforms you can use Unicode escapes.

Now TeX (not LaTeX) does not define exactly which glyph \mapsto should output, 
but Unicode \u21A6 is often called 'mapsto' (how Unicode glyphs are rendered is 
font-specific, of course).  That works for me with cairo-based devices on 
Linux; however on my Mac that glyph is not in the standard fonts for 
Quartz-based devices.


I did observe that I got failure to get that glyph to appear on a quartz or 
cairo_pdf device using either points() or text()  but this command did produce 
an error message that was able to find the glyph in the console font:


points(1,.8,"\u21A6")

Error in plot.xy(xy.coords(x, y), type = type, ...) : invalid plot type '‚'
In addition: Warning message:
In plot.xy(xy.coords(x, y), type = type, ...) :
   plot type '↦' will be truncated to first character


Hence my careful wording:  'the standard fonts for Quartz-based devices'.

I do not believe 'console font' is a well-defined quantity: perhaps you 
meant 'the default font of the R.app console', which many OS X users 
never use.  For a Terminal and R.app the font can be chosen by the user 


--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford
1 South Parks Road, Oxford OX1 3TG, UK

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Is there a plotmath symbol \mapsto?

2014-12-12 Thread David Winsemius

On Dec 12, 2014, at 5:32 AM, Prof Brian Ripley wrote:

> The only symbols plotmath has access to are those in the Adobe Symbol 
> encoding.  You can display all of those using the example at the bottom of 
> ?points, as ?plotmath did tell you.  (So it was a rather rich asking for an 
> example.)
> 
> It also tells you that on some devices/platforms you can use Unicode escapes.
> 
> Now TeX (not LaTeX) does not define exactly which glyph \mapsto should 
> output, but Unicode \u21A6 is often called 'mapsto' (how Unicode glyphs are 
> rendered is font-specific, of course).  That works for me with cairo-based 
> devices on Linux; however on my Mac that glyph is not in the standard fonts 
> for Quartz-based devices.

I did observe that I got failure to get that glyph to appear on a quartz or 
cairo_pdf device using either points() or text()  but this command did produce 
an error message that was able to find the glyph in the console font:

> points(1,.8,"\u21A6")
Error in plot.xy(xy.coords(x, y), type = type, ...) : invalid plot type '‚'
In addition: Warning message:
In plot.xy(xy.coords(x, y), type = type, ...) :
  plot type '↦' will be truncated to first character

-- 
David.
> 
> 
> On 12/12/2014 03:38, Marius Hofert wrote:
>> Hi,
>> 
>> Is there a plotmath symbol like LaTeX's \mapsto?
>> I need this comparably often, for example if you want to plot a
>> two-place function in one variable (and thus would like to have
>> ylab="t \mapsto f(t,s)", for example). If there is such a symbol, I'd
>> be great to have it as an example on ?plotmath.
>> 
>> Thanks & cheers,
>> 
>> Marius
> 
> 
> -- 
> Brian D. Ripley,  rip...@stats.ox.ac.uk
> Emeritus Professor of Applied Statistics, University of Oxford
> 1 South Parks Road, Oxford OX1 3TG, UK
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Is there a plotmath symbol \mapsto?

2014-12-12 Thread Marius Hofert
Dear Professor Ripley,

Thank you for your reply.
Do you specify \u21A6 via something like this?

plot(1, main=expression(symbol("\u21A6")))

This gives an the 'registered trademark symbol' (circled R) for me
(also cairo-based Linux).

Thanks and cheers,

Marius

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Is there a plotmath symbol \mapsto?

2014-12-12 Thread Prof Brian Ripley
The only symbols plotmath has access to are those in the Adobe Symbol 
encoding.  You can display all of those using the example at the bottom 
of ?points, as ?plotmath did tell you.  (So it was a rather rich asking 
for an example.)


It also tells you that on some devices/platforms you can use Unicode 
escapes.


Now TeX (not LaTeX) does not define exactly which glyph \mapsto should 
output, but Unicode \u21A6 is often called 'mapsto' (how Unicode glyphs 
are rendered is font-specific, of course).  That works for me with 
cairo-based devices on Linux; however on my Mac that glyph is not in the 
standard fonts for Quartz-based devices.



On 12/12/2014 03:38, Marius Hofert wrote:

Hi,

Is there a plotmath symbol like LaTeX's \mapsto?
I need this comparably often, for example if you want to plot a
two-place function in one variable (and thus would like to have
ylab="t \mapsto f(t,s)", for example). If there is such a symbol, I'd
be great to have it as an example on ?plotmath.

Thanks & cheers,

Marius



--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford
1 South Parks Road, Oxford OX1 3TG, UK

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.