SVG Error on Windows if Multiplication Character Present

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SVG Error on Windows if Multiplication Character Present

Dario Strbenac-2
Good day,

The example below fails on Windows with Error in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y: Metric information not available for this family/device.

library(ggplot2)
aPlot <- ggplot(ToothGrowth, aes(x = factor(dose), y = len)) + geom_boxplot() +
         ggtitle("Test", subtitle = ggplot2::expr(paste("p", " = ", "6.23", " × ", "10"^"-5")))
svg("test.svg"); aPlot; dev.off();

but there is no such problem on a Debian Linux server. The plot in Windows appears fine in an R graphics window. The error only occurs when exported as an SVG file. Using %*% instead of × avoids the error but it's perhaps worth mentioning in case it could be easily handled by R.

--------------------------------------
Dario Strbenac
University of Sydney
Camperdown NSW 2050
Australia
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: SVG Error on Windows if Multiplication Character Present

Paul Murrell-2
Hi

I have started to take a look at this, but it may be slow to debug on
Windows.

My initial finding was that the problem happened for me on BOTH svg()
and default windows() devices.  What R version are you using ?  (mine is
below)

 > sessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

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

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

Some additional information ...

 > capabilities()
jpeg png tiff tcltk X11 aqua
TRUE TRUE TRUE TRUE FALSE FALSE
http/ftp sockets libxml fifo cledit iconv
TRUE TRUE TRUE TRUE TRUE TRUE
NLS profmem cairo ICU long.double libcurl
TRUE TRUE TRUE TRUE TRUE TRUE

 > grSoftVersion()
cairo cairoFT pango
"1.16.0" "" ""
libpng jpeg libtiff
"1.6.37" "8.0" "LIBTIFF, Version 4.2.0"

Paul

On 7/04/21 8:00 pm, Dario Strbenac wrote:

> Good day,
>
> The example below fails on Windows with Error in
> grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y: Metric
> information not available for this family/device.
>
> library(ggplot2)
> aPlot <- ggplot(ToothGrowth, aes(x = factor(dose), y = len)) +
> geom_boxplot() +
> ggtitle("Test", subtitle = ggplot2::expr(paste("p", " = ", "6.23", " ×
> ", "10"^"-5")))
> svg("test.svg"); aPlot; dev.off();
>
> but there is no such problem on a Debian Linux server. The plot in
> Windows appears fine in an R graphics window. The error only occurs when
> exported as an SVG file. Using %*% instead of × avoids the error but
> it's perhaps worth mentioning in case it could be easily handled by R.
>
> --------------------------------------
> Dario Strbenac
> University of Sydney
> Camperdown NSW 2050
> Australia
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel 
> <https://stat.ethz.ch/mailman/listinfo/r-devel>

--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
[hidden email]
http://www.stat.auckland.ac.nz/~paul/

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel