[R] Plotmath isn't working for special characters

David Stevens d@v|d@@teven@ @end|ng |rom u@u@edu
Wed Jan 25 15:33:39 CET 2023


A more extensive test (no=produced an empty box on the plot, yes=produced the intended plotmath result). It appears that plotmath is not producing the special math characters. Greek symbols are produced. I'll try to reinstall R and report back.

David

plot(1,1, main = parse(text = "x >= y")) - no
plot(1,1, main = parse(text = "x == y")) - yes
plot(1,1, main = parse(text = "x <= y")) - no
plot(1,1, main = parse(text = "x ~ y")) - yes
plot(1,1, main = parse(text = "x * y")) - yes
plot(1,1, main = parse(text = "x %~~% y")) - no

plot(1,1, main = bquote(x %~~% y)) - no
plot(1,1, main = bquote(x  %prop% y)) - no

plot(1,1, main = expression(x  %prop% y)) - no
plot(1,1, main = expression(x == y)) - yes
plot(1,1, main = expression(x %+-% y)) - no
plot(1,1, main = expression(integral(f(x)*dx, a, b))) - no
plot(1,1, main = expression(sum(x[i], i==1, n))) - no
plot(1,1, main = expression(x^(y + z))) - yes
plot(1,1, main = expression(inf(x))) - no
plot(1,1, main = expression(x[(y + z)])) - yes

David K Stevens, PhD, PE, Professor
Civil and Environmental Engineering
Utah Water Research Laboratory
Utah State University
8200 Old Main Hill
Logan, UT 84322-8200
david.stevens using usu.edu<mailto:david.stevens using usu.edu>
(435) 797-3229 (office)

On 1/24/2023 3:33 PM, Bert Gunter wrote:
Also works for me on a Mac Ventura in the RStudio graphics device. Just for the heckuva it, does
plot(1,1,main= quote( x >= y ))
work? I shouldn't think so, but ...

Cheers,
Bert



On Tue, Jan 24, 2023 at 1:43 PM David Stevens <david.stevens using usu.edu<mailto:david.stevens using usu.edu>> wrote:
Simple expressions on plots, such as parse(text='x >= y') have been
resulting in just a placeholder box (x box y and not the symbol) in my R
plot labels in windows, R v 4.2.2. I haven't down an exhaustive test but
<= and >= have this behavior.

plot(1,1,main=parse(text="x >= y"))

Has anyone else seen this?

best

David

--
David K Stevens, PhD, PE, Professor
Civil and Environmental Engineering
Utah Water Research Laboratory
Utah State University
8200 Old Main Hill
Logan, UT 84322-8200
david.stevens using usu.edu<mailto:david.stevens using usu.edu>
(435) 797-3229 (office)

______________________________________________
R-help using r-project.org<mailto:R-help using 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.

	[[alternative HTML version deleted]]



More information about the R-help mailing list