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

facetting and circular allignment #180

Merged
merged 34 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2547f92
issue 49 done
vladdez May 21, 2024
ccf48fb
implementation of line break in faceting
vladdez May 21, 2024
2bd7dd5
highlights in docs
vladdez May 21, 2024
ad725af
format
vladdez May 27, 2024
13db522
format 2
vladdez May 27, 2024
bb02a35
bbox fitting
vladdez May 27, 2024
742f0c1
error test for erpimage
vladdez May 27, 2024
871f426
small changes
vladdez May 27, 2024
cb3b60b
defineing topoplotseries by number of bin width
vladdez May 29, 2024
d566737
transparency examples
vladdez May 29, 2024
807698e
docs bugs
vladdez May 29, 2024
1cdb741
error managment for df_timebins
vladdez May 29, 2024
eef23dc
bug
vladdez May 30, 2024
d7de5f4
two args renamed, more user-frienlz facetting (buggy for categorical)@
vladdez May 30, 2024
3c7f69a
dividing topopploteseries testing
vladdez May 31, 2024
af47f21
better separation of cat and contionous toposeries
vladdez Jun 10, 2024
d9e3ab6
deleting old test file
vladdez Jun 10, 2024
14e7bd0
compat with new Mkie version for pp
vladdez Jun 11, 2024
7b4849f
refactoring topoplotseries
vladdez Jun 11, 2024
604e2d4
compat for butterfly
vladdez Jun 11, 2024
cf35797
small reformatting
vladdez Jun 11, 2024
8248d2e
bug
vladdez Jun 11, 2024
3a7a6a3
last bug from incompatibility
vladdez Jun 13, 2024
9631a93
adjusting docs for toposeries
vladdez Jun 13, 2024
5ce397e
bug
vladdez Jun 13, 2024
81a0345
issue 182
vladdez Jun 13, 2024
54cf06f
issue 183
vladdez Jun 13, 2024
9c2b221
bug
vladdez Jun 13, 2024
bfe5628
code principles (draft)
vladdez Jun 13, 2024
5f24e32
i hate this stupid buggy package
vladdez Jun 13, 2024
218cb66
text clarification
vladdez Jun 13, 2024
fb2d3a0
after review
vladdez Jun 17, 2024
351c93a
formatting and library
vladdez Jun 17, 2024
f5598b0
bug@
vladdez Jun 17, 2024
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
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ MakieThemes = "e296ed71-da82-5faf-88ab-0034a9761098"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is very unlikely that you need stats base and statistics. Better to choose one

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i used StatsBase for debugging

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then it doesnt need to be in the project.toml

TopoPlots = "2bdbdf9c-dbd8-403f-947b-1a4e0dd41a7a"
Unfold = "181c99d8-e21b-4ff3-b70b-c233eddec679"

Expand Down
8 changes: 4 additions & 4 deletions docs/literate/how_to/mult_vis_in_fig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ plot_designmatrix!(f[2, 3], designmatrix(uf))
plot_topoplot!(f[3, 1], data[:, 150, 1]; positions = positions)
plot_topoplotseries!(
f[4, 1:3],
d_topo,
0.1;
d_topo;
bin_width = 0.1,
positions = positions,
mapping = (; label = :channel),
)
Expand Down Expand Up @@ -166,8 +166,8 @@ plot_topoplot!(gc, data[:, 340, 1]; positions = positions, axis = (; xlabel = "[

plot_topoplotseries!(
vladdez marked this conversation as resolved.
Show resolved Hide resolved
gd,
df,
80;
df;
bin_width = 80,
positions = positions,
visual = (label_scatter = false,),
layout = (; use_colorbar = true),
Expand Down
16 changes: 16 additions & 0 deletions docs/literate/how_to/position2color.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,19 @@ plot_butterfly(
positions = positions,
topopositions_to_color = x -> Colors.RGB(0.5),
)

# Transparency
# Unlike RGB, RGBA has a fourth channel, alpha, which is responsible for transparency.
# Here are two examples of how to manipulate it.

plot_butterfly(
results;
positions = positions,
topopositions_to_color = x -> (RGBA(UnfoldMakie.pos_to_color_RomaO(x), 1)),
)

plot_butterfly(
results;
positions = positions,
topopositions_to_color = x -> (GrayA(UnfoldMakie.pos_to_color_RomaO(x), 0.5)),
)
2 changes: 1 addition & 1 deletion docs/literate/intro/plot_types.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # The Dilemma of Multidimensionality

# !!! note
# Please read the paper [The Art of Brainwaves](https://apertureneuro.org/article/116386-the-art-of-brainwaves-a-survey-on-event-related-potential-visualization-practices), if you want to know more about how we come up with these plot types.
# Please read the paper [The Art of Brainwaves](https://apertureneuro.org/article/116386-the-art-of-brainwaves-a-survey-on-event-related-potential-visualization-practices), if you want to know how we come up with these plot types.
#=
EEG – multidimensional data and could be presented differently.
Expand Down
22 changes: 11 additions & 11 deletions docs/literate/tutorials/topoplotseries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,39 @@ nothing #hide

# # Plotting

Δbin = 80
plot_topoplotseries(df, Δbin; positions = positions)
bin_width = 80
plot_topoplotseries(df; bin_width, positions = positions)

# # Additional features

# ## Disabling colorbar

plot_topoplotseries(df, Δbin; positions = positions, layout = (; use_colorbar = false))
plot_topoplotseries(df; bin_width, positions = positions, layout = (; use_colorbar = false))

# ## Aggregating functions
# In this example `combinefun` is specified by `mean`, `median` and `std`.

f = Figure(size = (500, 500))
plot_topoplotseries!(
f[1, 1],
df,
Δbin;
df;
bin_width,
positions = positions,
combinefun = mean,
axis = (; title = "combinefun = mean"),
)
plot_topoplotseries!(
f[2, 1],
df,
Δbin;
df;
bin_width,
positions = positions,
combinefun = median,
axis = (; title = "combinefun = median"),
)
plot_topoplotseries!(
f[3, 1],
df,
Δbin;
df;
bin_width,
positions = positions,
combinefun = std,
axis = (; title = "combinefun = std"),
Expand Down Expand Up @@ -83,8 +83,8 @@ f = Figure(size = (600, 500))

plot_topoplotseries!(
f[1:2, 1:2],
df1,
Δbin;
df1;
bin_width,
col_labels = true,
mapping = (; row = :condition),
axis = (; ylabel = "Conditions"),
Expand Down
6 changes: 3 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using Glob

GENERATED = joinpath(@__DIR__, "src", "generated")
SOURCE = joinpath(@__DIR__, "literate")
for subfolder ∈ ["how_to", "intro", "tutorials", "reference"]
for subfolder ∈ ["how_to", "intro", "tutorials", "explanations"]
behinger marked this conversation as resolved.
Show resolved Hide resolved
local SOURCE_FILES = Glob.glob(subfolder * "/*.jl", SOURCE)
foreach(fn -> Literate.markdown(fn, GENERATED * "/" * subfolder), SOURCE_FILES)
end
Expand Down Expand Up @@ -56,8 +56,8 @@ makedocs(;
"Hide Decorations and Axis Spines" => "generated/how_to/hide_deco.md",
"Include multiple figures in one" => "generated/how_to/mult_vis_in_fig.md",
],
"Reference" => [
"Convert electrode positions from 3D to 2D" => "generated/reference/positions.md",
"Explanations" => [
"Convert electrode positions from 3D to 2D" => "generated/explanations/positions.md",
],
"API / DocStrings" => "api.md",
"Utilities" => "helper.md",
Expand Down
16 changes: 9 additions & 7 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
<img src="assets/complex_plot.png" width="300" align="right"/>
```

This is the documentation of the UnfoldMakie.jl module (aka library) for the Julia programming language.
This is the documentation of the UnfoldMakie.jl package for the Julia programming language.

## Benefits of UnfoldMakie.jl
## Highlights of UnfoldMakie.jl

- **10 plot functions for displaying ERPs.**
Each plot emphasizes certain dimensions while collapsing others.
- **Fast plotting**
Plot one figure with 20 topoplots in 1 second? No problemo!
- **Highly adaptable.**
The module is based on the [Unfold](https://github.com/unfoldtoolbox/unfold.jl/) and [Makie](https://makie.juliaplots.org/stable/) modules, so you can use configurations from these modules to add new features to your figures.
The package is primarily based on [Unfold.jl](https://github.com/unfoldtoolbox/unfold.jl/) and [Makie.jl](https://makie.juliaplots.org/stable/).
vladdez marked this conversation as resolved.
Show resolved Hide resolved
- **Many usage examples**
Here in documentation you can find user-friendly examples of how to use plots.
- **Scientific colormaps as default**
According to our study (Mikheev, 2024), 40% of EEG researchers do not know about the issue of scientific color maps. To protect the scientific integrity, we used `Reverse(:RdBu)` and `Roma` as default color maps.
You can find many user-friendly examples of how to use and adapt the plots in this documentation.
- **Scientific colormaps by default**
According to our study [(Mikheev, 2024)](https://apertureneuro.org/article/116386-the-art-of-brainwaves-a-survey-on-event-related-potential-visualization-practices),, 40% of EEG researchers do not know about the issue of scientific color maps. By default, we use `Reverse(:RdBu)` (based on [colorbrewer](https://colorbrewer2.org/#type=sequential&scheme=BuGn&n=3)) and `Roma` (based on [Sceintific Colormaps](https://www.fabiocrameri.ch/colourmaps/) by Fabio Crameri) as default color maps.
- **Interactivity**
Several plots use Observables and have interactive mode so you can click on them and change their layout. Check `plot_topoplotseries` and `plot_erpimage`.
Several plots make use of `Observables.jl` which allows fast updating of the underlying data. Several plots already have predfined interactive features, e.g. you can click on labels to enable / disable them. See `plot_topoplotseries` and `plot_erpimage` for examples.
1 change: 1 addition & 0 deletions src/UnfoldMakie.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ using DataFrames
using SparseArrays
using CategoricalArrays # for cut for TopoPlotSeries
using StaticArrays
using StatsBase

using CoordinateTransformations # for 3D positions to 2D

Expand Down
Loading
Loading