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

add warning if data == 0 #93

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/plot_topoplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ function plot_topoplot!(

eeg_topoplot!(axis, plotData, labels; positions, config.visual...)

config_kwargs!(config, colorbar = (; limits = (min(plotData...), max(plotData...))))
clims = (min(plotData...), max(plotData...))
if clims[1] ≈ clims[2]
@warn """The min and max of the value represented by the color are the same, it seems that the data values are identical.
We disable the color bar in this figure.
Note: The identical min and max may cause an interpolation error when plotting the topoplot."""
config_kwargs!(config, layout = (; useColorbar=false,showLegend=false))
else
config_kwargs!(config, colorbar = (; limits = clims))
end
applyLayoutSettings!(config; fig = f)

return f
Expand Down
Loading