Skip to content

Commit

Permalink
add warning if data == 0
Browse files Browse the repository at this point in the history
  • Loading branch information
behinger authored and vladdez committed Nov 14, 2023
1 parent 71faca8 commit e4a6bf4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/plot_topoplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ 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 """automatic colorlimits are the same, maybe all data is identical? Deactivating colorbar.
note: this might lead to an error later about interpolation when actually 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

0 comments on commit e4a6bf4

Please sign in to comment.