SVG Error on Windows if Multiplication Character Present

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message 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