dmurdoch/rgl

Axis labels are doubled in reprex::reprex()

Closed this issue · 0 comments

In rgl 0.109.2, the axis labels appear to be drawn twice when using reprex::reprex(). For example, this code from a SO question:

library(mgcViz)
#> Loading required package: mgcv
#> Loading required package: nlme
#> Warning: package 'nlme' was built under R version 4.1.2
#> This is mgcv 1.8-40. For overview type 'help("mgcv-package")'.
#> Loading required package: qgam
#> Loading required package: ggplot2
#> Warning: package 'ggplot2' was built under R version 4.1.2
#> Registered S3 method overwritten by 'GGally':
#>   method from   
#>   +.gg   ggplot2
#> Registered S3 method overwritten by 'mgcViz':
#>   method from  
#>   +.gg   GGally
#> 
#> Attaching package: 'mgcViz'
#> The following objects are masked from 'package:stats':
#> 
#>     qqline, qqnorm, qqplot
library(rgl)

n <- 500
x <- rnorm(n); y <- rnorm(n); z <- rnorm(n)
ob <- (x-z)^2 + (y-z)^2 + rnorm(n)
b <- gam(ob ~ s(x, y, z))
b <- getViz(b)

open3d()
#> glX 
#>   1
plotRGL(sm(b, 1), fix = c("z" = 0), residuals = TRUE)
planes3d(0,0,1,-5, col = "gray")

Created on 2022-06-24 by the reprex package (v2.0.1)