Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash in plot_AbanicoPlot() if zlim = NULL #581

Closed
mcol opened this issue Feb 25, 2025 · 2 comments · Fixed by #582
Closed

crash in plot_AbanicoPlot() if zlim = NULL #581

mcol opened this issue Feb 25, 2025 · 2 comments · Fixed by #582
Labels
bug Clear problem or crash
Milestone

Comments

@mcol
Copy link
Contributor

mcol commented Feb 25, 2025

This crashes:

data(ExampleData.DeValues, envir = environment())
plot_AbanicoPlot(ExampleData.DeValues$CA1, zlim = NULL)

# Error in round(pretty(limits.z, n = 5), 3) :
#   non-numeric argument to mathematical function

For some reason this gets triggered by RLumShiny.

@mcol mcol added the bug Clear problem or crash label Feb 25, 2025
@mcol mcol added this to the v1.1.0 milestone Feb 25, 2025
@mcol
Copy link
Contributor Author

mcol commented Feb 25, 2025

I've just noticed this duplication:

if("zlim" %in% names(extraArgs)) {
limits.z <- extraArgs$zlim
} else {
z.span <- (mean(De.global) * 0.5) / (sd(De.global) * 100)
z.span <- ifelse(z.span > 1, 0.9, z.span)
limits.z <- c((ifelse(min(De.global) <= 0, 1.1, 0.9) - z.span) *
min(De.global),
(1.1 + z.span) * max(De.global))
}

if("zlim" %in% names(extraArgs)) {
limits.z <- extraArgs$zlim
} else {
z.span <- (mean(data.global[,1]) * 0.5) / (sd(data.global[,1]) * 100)
z.span <- ifelse(z.span > 1, 0.9, z.span)
limits.z <- c((0.9 - z.span) * min(data.global[[1]]),
(1.1 + z.span) * max(data.global[[1]]))
}

@mcol
Copy link
Contributor Author

mcol commented Feb 26, 2025

The first block is used to set the value of the at graphical parameter, the second one is the one actually used for zlim. This code has been there since the first commit, and as we don't have comprehensive graphical snapshots yet, I'll leave that untouched. That means putting a NULL check in both places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Clear problem or crash
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant