R-Lum/Luminescence

plot_RadialPlot() - `line = 0` not shown at the correct position under particular circumstances

RLumSK opened this issue · 1 comments

Describe the bug

The parameter line that allows adding additional lines to the plot does not work correctly under
all circumstances. If log.z = FALSE and the points are close to zero, the horizontal lines is drawn with an offset. However,
the rest of the plot is correct.

Please add a minimalistic reproducible example

library(Luminescence)

plot_RadialPlot(
  data.frame(x = rnorm(20, 0, 1), y = runif(20, 0.1, 0.5)),
  line = 0.2,
  log.z = FALSE,
  plot.ratio = 0.3,
  zlim = c(-1, 6))

Expected behaviour
A clear and concise description of what you expected to happen.

Screenshots
Screenshot 2021-09-09 at 08 13 15

Session info

R Under development (unstable) (2021-08-22 r80810)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.5.2

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

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

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

other attached packages:
[1] Luminescence_0.9.16.9000-13

loaded via a namespace (and not attached):
 [1] httr_1.4.2        compiler_4.2.0    R6_2.5.1          parallel_4.2.0    tools_4.2.0      
 [6] sp_1.4-5          Rcpp_1.0.7        raster_3.4-13     codetools_0.2-18  grid_4.2.0       
[11] data.table_1.14.0 lattice_0.20-44  

Additional information

It clearly depends on the settings, if the example above is modified, e.g., the dose set to 5 instead of 0 here, the settings work as expected.

The bug was reported by Li Bo via email.

I guess I fixed it.