Skip to content

Commit

Permalink
also for plot_erpimage
Browse files Browse the repository at this point in the history
  • Loading branch information
vladdez committed Sep 20, 2024
1 parent 577b3b8 commit a855d9c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
10 changes: 10 additions & 0 deletions src/docstring_template.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,15 @@ function indiv_docstrings(cfg_symb::Symbol)
valign = 0.95,
aspect = 1,
)
# plot_erpimage
elseif cfg_symb == :meanplot_default
return (;
height = 100,
xlabel = "Time [s]",
xlabelpadding = 0,
xautolimitmargin = (0, 0),
)
elseif cfg_symb == :sortplot_default
return (; ylabelvisible = true, yticklabelsvisible = false)
end
end
16 changes: 7 additions & 9 deletions src/plot_erpimage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ Plot an ERP image.
If `sortvalues = true` the default text will change to "Sorted trials", but it could be changed to any values specified manually.
- `meanplot_axis::NamedTuple = (;)`\\
Here you can flexibly change configurations of meanplot.\\
To see all options just type `?Axis` in REPL.
To see all options just type `?Axis` in REPL.\\
Defaults: $(indiv_docstrings(:meanplot_default))
- `sortplot_axis::NamedTuple = (;)`\\
Here you can flexibly change configurations of meanplot.\\
To see all options just type `?Axis` in REPL.
To see all options just type `?Axis` in REPL.\\
Defaults: $(indiv_docstrings(:sortplot_default))
$(_docstring(:erpimage))
Expand Down Expand Up @@ -134,13 +136,11 @@ function ei_meanplot(ax, data, config, f, ga, times, meanplot_axis)
ax.xticklabelsvisible = false

trace = @lift(mean($data, dims = 2)[:, 1])
meanplot_axis = update_axis(indiv_docstrings(:meanplot_default); meanplot_axis...)

axbottom = Axis(
ga[5, 1:4];
height = 100,
ylabel = config.colorbar.label === nothing ? "" : config.colorbar.label,
xlabel = "Time [s]",
xlabelpadding = 0,
xautolimitmargin = (0, 0),
limits = @lift((
minimum($times),
maximum($times),
Expand All @@ -163,11 +163,10 @@ function ei_sortvalue(sortvalues, f, ax, hm, config, sortval_xlabel, sortplot_ax
error("`show_sortval` can not take `sortvalues` with all NaN-values")
end
gb = f[1, 3] = GridLayout()
sortplot_axis = update_axis(indiv_docstrings(:sortplot_default); sortplot_axis...)
axleft = Axis(
gb[1:4, 1:5];
xlabel = sortval_xlabel,
ylabelvisible = true,
yticklabelsvisible = false,
#xautolimitmargin = (-1, 1),
#yautolimitmargin = (1, 100),
xticks = @lift([
Expand All @@ -188,7 +187,6 @@ function ei_sortvalue(sortvalues, f, ax, hm, config, sortval_xlabel, sortplot_ax
hidedecorations!(axempty)
hidespines!(axempty)
hidespines!(axleft, :r, :t)
#scatter!(axleft, xs, ys)
lines!(axleft, xs, ys)
if config.layout.use_colorbar != false
Colorbar(
Expand Down

0 comments on commit a855d9c

Please sign in to comment.