Skip to content

Plotmath isn't working for special characters

10 messages · Spencer Graves, Bert Gunter, Richard O'Keefe +5 more

#
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
#
On 1/24/23 3:33 PM, David Stevens wrote:
What's your "sessionInfo()"?


	  I got the symbol, not problem.  Spencer Graves


sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.7.2

Matrix products: default
LAPACK: 
/Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods
[7] base

loaded via a namespace (and not attached):
[1] compiler_4.2.2  tools_4.2.2     rstudioapi_0.14
[4] remotes_2.4.2
 > >
#
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 at usu.edu> wrote:

            

  
  
#
plot(1,1, main=quote(x>=y))
produces the symbol for me.
plot(1,1, main=parse(text="x>=y"))
also produces the symbol.

 setting  value
 version  R version 4.2.2 Patched (2022-11-10 r83330)
 os       Ubuntu 22.04.1 LTS
 system   x86_64, linux-gnu
 ui       X11
 language en_NZ:en
 collate  en_NZ.iso88591
 ctype    en_NZ.iso88591
 tz       Pacific/Auckland
 date     2023-01-25
 pandoc   2.9.2.1 @ /usr/bin/pandoc

- Packages
-------------------------------------------------------------------
 package     * version date (UTC) lib source
 cli           3.4.1   2022-09-23 [1] CRAN (R 4.2.2)
 sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.2.2)

 [1] /home/ok/R/x86_64-pc-linux-gnu-library/4.2
 [2] /usr/local/lib/R/site-library
 [3] /usr/lib/R/site-library
 [4] /usr/lib/R/library
On Wed, 25 Jan 2023 at 12:34, Bert Gunter <bgunter.4567 at gmail.com> wrote:

            

  
  
#
On Tue, 24 Jan 2023 21:33:48 +0000
David Stevens <david.stevens at usu.edu> wrote:

            
Here's a recently fixed bug that may be related:
https://bugs.r-project.org/show_bug.cgi?id=18440

Does the R-patched build work for you?
https://cloud.r-project.org/bin/windows/base/rpatched.html
#
?s 21:53 de 24/01/2023, Spencer Graves escreveu:
Hello,

I can reproduce the problem in RGui, R 4.2.2 on Windows 11.
Any of the following solved it.


plot(1,1, main=bquote(x~"\u2265"~y))
plot(1,1, main=expression(x~"\u2265"~y))


Hope this helps,

Rui Barradas
#
?s 12:36 de 25/01/2023, Rui Barradas escreveu:
Sorry, forgot the


sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22621)

Matrix products: default

locale:
[1] LC_COLLATE=Portuguese_Portugal.utf8 
LC_CTYPE=Portuguese_Portugal.utf8
[3] LC_MONETARY=Portuguese_Portugal.utf8 LC_NUMERIC=C 

[5] LC_TIME=Portuguese_Portugal.utf8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_4.2.2


Rui Barradas
#
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 at usu.edu<mailto:david.stevens at 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 at usu.edu<mailto:david.stevens at 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 at usu.edu<mailto:david.stevens at usu.edu>
(435) 797-3229 (office)

______________________________________________
R-help at r-project.org<mailto:R-help at 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.
#
I see the same thing using 4.2.2 on Windows 10.


Thank you kindly,
Shawn Way, PE???Director of Engineering
Phone: (832) 403-0414
Empower Pharmacy???Expanding Access.
??????

-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of David Stevens
Sent: Wednesday, January 25, 2023 8:34 AM
To: Bert Gunter <bgunter.4567 at gmail.com>
Cc: r-help at r-project.org
Subject: Re: [R] Plotmath isn't working for special characters

External Email: This message originated from outside Empower Pharmacy. Please exercise caution before opening attachments, clicking links, replying, or providing information to the sender.


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 at usu.edu<mailto:david.stevens at 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 at usu.edu<mailto:david.stevens at 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 at usu.edu<mailto:david.stevens at usu.edu>
(435) 797-3229 (office)

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


______________________________________________
R-help at 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.
#
Yes, and is is fixed in R-4.2.2-pacthed for soe  time already.

Best,
Uwe Ligges
On 25.01.2023 15:48, Shawn Way wrote: