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

Horizontal colorbars and other topoplot issues #292

Merged
merged 4 commits into from
Jan 13, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
workaround for 251
  • Loading branch information
vladdez committed Jan 13, 2025

Verified

This commit was signed with the committer’s verified signature.
Robbepop Robin Freyler
commit 42813648307df0dc5ee81a4f04d69260b7fa31de
1 change: 1 addition & 0 deletions docs/literate/intro/speed.jl
Original file line number Diff line number Diff line change
@@ -106,6 +106,7 @@ end
# ![](topoplot_animation_UM.gif)

# MNE with .gif
# Note that due to some bugs in (probably) `CondaPkg` topoplot is blac and white.
@benchmark begin
fig, anim = simulated_epochs.animate_topomap(
times = Py(timestamps),
2 changes: 1 addition & 1 deletion src/eeg_series.jl
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ The function takes the `combinefun = mean` over the `:time` column of `data`.
- `topo_attributes::NamedTuple = (;)`\\
Here you can flexibly change configurations of the topoplot interoplation.\\
To see all options just type `?Topoplot.topoplot` in REPL.\\
Defaults: $(supportive_defaults(:topo_default_attributes)).
Defaults: $(replace(string(supportive_defaults(:topo_default_attributes; docstring = true)), "_" => "\\_")).
- `positions::Vector{Point{2, Float32}}`\\
Channel positions. The list of x and y positions for all unique electrodes.

2 changes: 1 addition & 1 deletion src/plot_erpimage.jl
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ Plot an ERP image.
`Figure`, `GridLayout`, or `GridPosition` to draw the plot.
- `data::Union{DataFrame, Vector{Float32}}`\\
Data for the plot visualization.

## Keyword arguments (kwargs)
- `erpblur::Number = 10`\\
Number indicating how much blur is applied to the image. \\
2 changes: 1 addition & 1 deletion src/plot_topoplot.jl
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ Plot a topoplot.
- `topo_attributes::NamedTuple = (;)`\\
Here you can flexibly change configurations of the topoplot interoplation.\\
To see all options just type `?Topoplot.topoplot` in REPL.\\
Defaults: $(supportive_defaults(:topo_default_attributes))
Defaults: $(replace(string(supportive_defaults(:topo_default_attributes; docstring = true)), "_" => "\\_"))
$(_docstring(:topoplot))

**Return Value:** `Figure` displaying the Topoplot.
2 changes: 1 addition & 1 deletion src/plot_topoplotseries.jl
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ Multiple miniature topoplots in regular distances.
- `topo_attributes::NamedTuple = (;)`\\
Here you can flexibly change configurations of the topoplot interoplation.\\
To see all options just type `?Topoplot.topoplot` in REPL.\\
Defaults: $(supportive_defaults(:topo_default_attributes))
Defaults: $(replace(string(supportive_defaults(:topo_default_attributes; docstring = true)), "_" => "\\_"))

$(_docstring(:topoplotseries))

8 changes: 6 additions & 2 deletions src/supportive_defaults.jl
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ Such supporting axes allow users to flexibly see defaults in docstrings and mani
For developers: to make them updateable in the function, use `update_axis`.
**Return value:** `NamedTuple`.
"""
function supportive_defaults(cfg_symb::Symbol)
function supportive_defaults(cfg_symb::Symbol; docstring = false)
# plot_splines
if cfg_symb == :spline_default
return (;
@@ -65,7 +65,11 @@ function supportive_defaults(cfg_symb::Symbol)
aspect = DataAspect(),
)
elseif cfg_symb == :topo_default_attributes
return (; interp_resolution = (128, 128), interpolation = CloughTocher())
if docstring == false
return (; interp_resolution = (128, 128), interpolation = CloughTocher())
else
return string("interp_resolution = (128, 128), interpolation = CloughTocher()")
end
# plot_topoplotseries
elseif cfg_symb == :topo_default_series
return (;