From 6353b963c379a951e3ac7d2e33c49cff37264749 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Mon, 11 Sep 2023 19:15:19 +0000 Subject: [PATCH] build based on 22f784e --- dev/config/axis_data/index.html | 2 +- dev/config/colorbar_data/index.html | 2 +- dev/config/extra_data/index.html | 2 +- dev/config/layout_data/index.html | 4 +-- dev/config/legend_data/index.html | 2 +- dev/config/mapping_data/index.html | 4 +-- dev/config/visual_data/index.html | 2 +- dev/how_to/fix_pcp/index.html | 4 +-- dev/how_to/hide_deco/index.html | 4 +-- dev/how_to/mult_vis_in_fig/index.html | 4 +-- dev/how_to/position2color/index.html | 4 +-- dev/how_to/show_oob_labels/index.html | 4 +-- dev/index.html | 2 +- dev/literate/reference/positions.jl | 30 -------------------- dev/literate/reference/positions/index.html | 22 -------------- dev/literate/tutorials/circTopo/index.html | 4 +-- dev/literate/tutorials/erp/index.html | 4 +-- dev/search/index.html | 2 +- dev/search_index.js | 2 +- dev/tutorials/butterfly/index.html | 4 +-- dev/tutorials/designmatrix/index.html | 4 +-- dev/tutorials/erpimage/index.html | 4 +-- dev/tutorials/installation/index.html | 4 +-- dev/tutorials/parallelcoordinates/index.html | 4 +-- dev/tutorials/topoplot/index.html | 4 +-- dev/tutorials/topoplotseries/index.html | 4 +-- 26 files changed, 40 insertions(+), 92 deletions(-) delete mode 100644 dev/literate/reference/positions.jl delete mode 100644 dev/literate/reference/positions/index.html diff --git a/dev/config/axis_data/index.html b/dev/config/axis_data/index.html index ee1b4c8e5..99604e9e6 100644 --- a/dev/config/axis_data/index.html +++ b/dev/config/axis_data/index.html @@ -1,2 +1,2 @@ -Axis Data · UnfoldMakie.jl

Axis Data

The axis data of the configuration consists of config options for the axis.

The input of this config is directly fed into the Axis function of the Makie module. As a consequence, the possible options are also determined by the function. Details for these options can be found in the corresponding article of the Makie documentation.

+Axis Data · UnfoldMakie.jl

Axis Data

The axis data of the configuration consists of config options for the axis.

The input of this config is directly fed into the Axis function of the Makie module. As a consequence, the possible options are also determined by the function. Details for these options can be found in the corresponding article of the Makie documentation.

diff --git a/dev/config/colorbar_data/index.html b/dev/config/colorbar_data/index.html index 99a3d42ee..14978b284 100644 --- a/dev/config/colorbar_data/index.html +++ b/dev/config/colorbar_data/index.html @@ -1,2 +1,2 @@ -Colorbar Data · UnfoldMakie.jl

Colorbar Data

The colorbar data of the configuration consists of config options for the colorbar that can be used as a legend. As a consequence, the possible options are determined by the underlying functions.

ERP Plots

For ERP plots, the colorbar! function of the AlgebraOfGraphics module is used (documentation).

The Colorbar will be automatically used, when AlgebraOfGraphics is able to draw it. For this, the color data will be used and has to be numerical. Furthermore extra=(;categoricalColor=false) needs to be false.

Other Plots

In all other Plots the Colorbar function of the Makie module is used (documentation).

The Colorbar will only be used when both layoutData.showLegend and layoutData.useColorbar are set true.

Colorbar data default values

  • vertical = true
  • tellwidth = true
  • tellheight = true
+Colorbar Data · UnfoldMakie.jl

Colorbar Data

The colorbar data of the configuration consists of config options for the colorbar that can be used as a legend. As a consequence, the possible options are determined by the underlying functions.

ERP Plots

For ERP plots, the colorbar! function of the AlgebraOfGraphics module is used (documentation).

The Colorbar will be automatically used, when AlgebraOfGraphics is able to draw it. For this, the color data will be used and has to be numerical. Furthermore extra=(;categoricalColor=false) needs to be false.

Other Plots

In all other Plots the Colorbar function of the Makie module is used (documentation).

The Colorbar will only be used when both layoutData.showLegend and layoutData.useColorbar are set true.

Colorbar data default values

  • vertical = true
  • tellwidth = true
  • tellheight = true
diff --git a/dev/config/extra_data/index.html b/dev/config/extra_data/index.html index ec89a1a29..95190951b 100644 --- a/dev/config/extra_data/index.html +++ b/dev/config/extra_data/index.html @@ -1,2 +1,2 @@ -Extra Data · UnfoldMakie.jl

Extra Data

The extra data of the configuration consists of all config options that are unique for the visualizations.

The available options for each plot are described at the end of their respective tutorial in the Tutorials: Visualizations section.

+Extra Data · UnfoldMakie.jl

Extra Data

The extra data of the configuration consists of all config options that are unique for the visualizations.

The available options for each plot are described at the end of their respective tutorial in the Tutorials: Visualizations section.

diff --git a/dev/config/layout_data/index.html b/dev/config/layout_data/index.html index deb974b9c..eb45115fa 100644 --- a/dev/config/layout_data/index.html +++ b/dev/config/layout_data/index.html @@ -1,6 +1,6 @@ -Layout Data · UnfoldMakie.jl

Layout Data

The layout data of the configuration consists of config options for the layout such as the legend and labels.

The following layout data options exist (the default values may be different for some plots types):

showLegend (boolean)

Indicating whether the legend is displayed. Default is true.

legendPostion (Symbol)

Indicating the position and orientation of the legend. Possible values are :right and :bottom. Default is :right.

useColorbar (boolean)

Indicating whether the colorbar should be used. Default is false.

xlabelFromMapping (Symbol/Nothing)

Which data column should be used for the xlabel. Set to nothing if no column name should be used. Default is :x.

ylabelFromMapping (Symbol/Nothing)

Which data column should be used for the ylabel. Set to nothing if no column name should be used. Default is :y.

other Makie functions

In addition to the previous options the hidespines! and hidedecorations! functions from the Makie module can be enabled by setting their respective parameters as follows.

config.setLayoutValues(
+Layout Data · UnfoldMakie.jl

Layout Data

The layout data of the configuration consists of config options for the layout such as the legend and labels.

The following layout data options exist (the default values may be different for some plots types):

showLegend (boolean)

Indicating whether the legend is displayed. Default is true.

legendPostion (Symbol)

Indicating the position and orientation of the legend. Possible values are :right and :bottom. Default is :right.

useColorbar (boolean)

Indicating whether the colorbar should be used. Default is false.

xlabelFromMapping (Symbol/Nothing)

Which data column should be used for the xlabel. Set to nothing if no column name should be used. Default is :x.

ylabelFromMapping (Symbol/Nothing)

Which data column should be used for the ylabel. Set to nothing if no column name should be used. Default is :y.

other Makie functions

In addition to the previous options the hidespines! and hidedecorations! functions from the Makie module can be enabled by setting their respective parameters as follows.

config.setLayoutValues(
     ...
     hidespines = (:r, :t),
     hidedecorations = ()
-)

Setting them to nothing will disable them. More information on how to use them can be found in this HowTo

+)

Setting them to nothing will disable them. More information on how to use them can be found in this HowTo

diff --git a/dev/config/legend_data/index.html b/dev/config/legend_data/index.html index 6dd3effd4..491eb2ca4 100644 --- a/dev/config/legend_data/index.html +++ b/dev/config/legend_data/index.html @@ -1,2 +1,2 @@ -Legend Data · UnfoldMakie.jl

Legend Data

The legend data of the configuration consists of config options for the legend.

Line Plots and Butterfly Plots

For line plots the legend! function of the AlgebraOfGraphics module is used (documentation).

The Legend will be used automatically, when AlgebraOfGraphics is able to draw it. For this the color data will be used and has to be either non-numerical or funcall(...;extra=(categoricalColor=true,) needs to be set true.

Parallel Coordinates Plots

In a parallel coordinate plot the Legend function of the Makie module is used (documentation).

The Legend will only be used when funcall(...;layout=(showLegend=true,) is true and funcall(...;layout=(useColorbar=false,) is false

Legend data default options

  • orientation = :vertical
  • tellwidth = true
  • tellheight = true
+Legend Data · UnfoldMakie.jl

Legend Data

The legend data of the configuration consists of config options for the legend.

Line Plots and Butterfly Plots

For line plots the legend! function of the AlgebraOfGraphics module is used (documentation).

The Legend will be used automatically, when AlgebraOfGraphics is able to draw it. For this the color data will be used and has to be either non-numerical or funcall(...;extra=(categoricalColor=true,) needs to be set true.

Parallel Coordinates Plots

In a parallel coordinate plot the Legend function of the Makie module is used (documentation).

The Legend will only be used when funcall(...;layout=(showLegend=true,) is true and funcall(...;layout=(useColorbar=false,) is false

Legend data default options

  • orientation = :vertical
  • tellwidth = true
  • tellheight = true
diff --git a/dev/config/mapping_data/index.html b/dev/config/mapping_data/index.html index 09aba6587..7486dc23e 100644 --- a/dev/config/mapping_data/index.html +++ b/dev/config/mapping_data/index.html @@ -1,3 +1,3 @@ -Mapping Data · UnfoldMakie.jl

Mapping Data

The mapping data of the configuration is used to let the plotting functions know which columns of a DataFrame contain which data. Therefore it is only used in plots with a DataFrame as input.

For example a Line Plot makes use of the x and y mappings. To have our Line Plot use the "estimate" column for x and the "time" column for y we can use:

plot_erp(...;mapping=(;x=:estimate,))
-

Which columns are used by which plotting function can be looked up in their respective tutorials in the Tutorials: Visualizations section.

Multiple Options

In addition to providing a single column which contains the specified data, the user can also provide a list of columns which may contain the data.

plot_erp(...;mapping=(;y = (:y, :yhat, :estimate)))

In this case the first available column will be chosen.

Some configurations for certain plots already have a default column or a list of columns set. This way the user might not need to set any mapping values themselves, in case the DataFrame conforms to the same standards.

+Mapping Data · UnfoldMakie.jl

Mapping Data

The mapping data of the configuration is used to let the plotting functions know which columns of a DataFrame contain which data. Therefore it is only used in plots with a DataFrame as input.

For example a Line Plot makes use of the x and y mappings. To have our Line Plot use the "estimate" column for x and the "time" column for y we can use:

plot_erp(...;mapping=(;x=:estimate,))
+

Which columns are used by which plotting function can be looked up in their respective tutorials in the Tutorials: Visualizations section.

Multiple Options

In addition to providing a single column which contains the specified data, the user can also provide a list of columns which may contain the data.

plot_erp(...;mapping=(;y = (:y, :yhat, :estimate)))

In this case the first available column will be chosen.

Some configurations for certain plots already have a default column or a list of columns set. This way the user might not need to set any mapping values themselves, in case the DataFrame conforms to the same standards.

diff --git a/dev/config/visual_data/index.html b/dev/config/visual_data/index.html index 0484a455e..e1f16c2cb 100644 --- a/dev/config/visual_data/index.html +++ b/dev/config/visual_data/index.html @@ -1,2 +1,2 @@ -Visual Data · UnfoldMakie.jl

Visual Data

The visual data of the configuration will be passed to the underlying plotting functions and can be used to set their specific attributes.

As a consequence, the possible options are determined by the following functions:

+Visual Data · UnfoldMakie.jl

Visual Data

The visual data of the configuration will be passed to the underlying plotting functions and can be used to set their specific attributes.

As a consequence, the possible options are determined by the following functions:

diff --git a/dev/how_to/fix_pcp/index.html b/dev/how_to/fix_pcp/index.html index e130ceb75..2fa4e566f 100644 --- a/dev/how_to/fix_pcp/index.html +++ b/dev/how_to/fix_pcp/index.html @@ -1,5 +1,5 @@ -Fix Parallel Coordinates Plot · UnfoldMakie.jl

Fix Parallel Coordinates Plot

Since Makie didn't have a native function to draw PCPs our version is somewhat experimental for broad applications.

Under certain circumstances the PCP is not properly visualized. This leads to cut off edges of the PCP, and unused space.

Especially when changing the container size by customizing the figure resolution, or adding multiple plots into one figure, the PCP can have problems fitting inside.

PCP with cutoff and bad spacing

We can set some variables to fix these issues using

paraConfig.setExtraValues(
+Fix Parallel Coordinates Plot · UnfoldMakie.jl

Fix Parallel Coordinates Plot

Since Makie didn't have a native function to draw PCPs our version is somewhat experimental for broad applications.

Under certain circumstances the PCP is not properly visualized. This leads to cut off edges of the PCP, and unused space.

Especially when changing the container size by customizing the figure resolution, or adding multiple plots into one figure, the PCP can have problems fitting inside.

PCP with cutoff and bad spacing

We can set some variables to fix these issues using

paraConfig.setExtraValues(
     ...
 )

Since the plot could have more space above and below, we can change the aspect ratio of the plot with:

...
 pc_aspect_ratio = 1,
@@ -10,4 +10,4 @@
 pc_bottom_padding = 27,
 ...

Furthermore, if the tick-number size becomes too big or small it can be changed with:

...
 pc_tick_label_size = 25,
-...

By setting these manually through trial and error we can fix the visualization issues:

Fixed PCP

+...

By setting these manually through trial and error we can fix the visualization issues:

Fixed PCP

diff --git a/dev/how_to/hide_deco/index.html b/dev/how_to/hide_deco/index.html index e5f04d5c0..d4550c08b 100644 --- a/dev/how_to/hide_deco/index.html +++ b/dev/how_to/hide_deco/index.html @@ -1,9 +1,9 @@ -Hide Axis Spines and Decorations · UnfoldMakie.jl

Hide Axis Spines and Decorations

In this section we discuss how users are able to efficiently hide axis spines and decorations in their plots.

While it's possible to hide these axis decorations through setting the axis settings with axis=(;...), Makie.Axis features multiple variables for different aspects of the plot. This means that removing all decoration is only possible by setting a lot of variables each time.

Makie does feature methods like hidespines! and hidedecorations!, but the user might not have easy acces to the axis their plot is drawn in.

So instead these functions can be called by setting variables with layout = (;):

... layout = (
+Hide Axis Spines and Decorations · UnfoldMakie.jl

Hide Axis Spines and Decorations

In this section we discuss how users are able to efficiently hide axis spines and decorations in their plots.

While it's possible to hide these axis decorations through setting the axis settings with axis=(;...), Makie.Axis features multiple variables for different aspects of the plot. This means that removing all decoration is only possible by setting a lot of variables each time.

Makie does feature methods like hidespines! and hidedecorations!, but the user might not have easy acces to the axis their plot is drawn in.

So instead these functions can be called by setting variables with layout = (;):

... layout = (
     ...
     hidespines = (),
     hidedecorations = ()
 )

Since these values mirror the input of the function, we can use an empty tuple to remove all decorations or spines respectively

And using hidespines = (:r, :t) results in the removal of the top and right border.

For more information on the input of these functions refer to the Makie dokumentation on Axis.

Since some plots hide features by default, the hiding can be reverted by setting the variables to nothing

plot_xxx(...;layout=(;
     hidespines = nothing,
     hidedecorations = nothing
-)

Topoplot with all axis spines and decorations enabled

+)

Topoplot with all axis spines and decorations enabled

diff --git a/dev/how_to/mult_vis_in_fig/index.html b/dev/how_to/mult_vis_in_fig/index.html index 5151be8c2..1ee18e670 100644 --- a/dev/how_to/mult_vis_in_fig/index.html +++ b/dev/how_to/mult_vis_in_fig/index.html @@ -1,5 +1,5 @@ -Include multiple Visualizations in one Figure · UnfoldMakie.jl

Include multiple Visualizations in one Figure

using UnfoldMakie
+Include multiple Visualizations in one Figure · UnfoldMakie.jl

Include multiple Visualizations in one Figure

using UnfoldMakie
 using CairoMakie
 using DataFramesMeta
 using UnfoldSim
@@ -61,4 +61,4 @@
 plot_circulareegtopoplot!(f[3:4, 4:5], d_topo[in.(d_topo.time, Ref(-0.3:0.1:0.5)), :]; 
     positions=positions, predictor=:time, extra=(; predictorBounds=[-0.3, 0.5]))
 
-f
+f
diff --git a/dev/how_to/position2color/index.html b/dev/how_to/position2color/index.html index 5ab9bee84..ba13aa9a5 100644 --- a/dev/how_to/position2color/index.html +++ b/dev/how_to/position2color/index.html @@ -1,7 +1,7 @@ -Butterfly Colormap · UnfoldMakie.jl

Change Butterfly Channel Position Color

In this section we discuss how users are able change the position to colorscale of the legendtopo in the butterfly plot.

using UnfoldMakie
+Butterfly Colormap · UnfoldMakie.jl

Change Butterfly Channel Position Color

In this section we discuss how users are able change the position to colorscale of the legendtopo in the butterfly plot.

using UnfoldMakie
 using CairoMakie
 using DataFramesMeta

By default the plot looks like this:

include("../../example_data.jl")
 results,positions = example_data("TopoPlots.jl")
 plot_butterfly(results;positions=positions)

We can switch the colorscale of the position-map, by giving a function that maps from a (x,y) tuple to a color. UnfoldMakie currently provides three different ones pos2colorRGB (same as MNE-Python), pos2colorHSV (HSV colorspace), pos2colorRomaO. Whereas RGB & HSV have the benefits of being 2D colormaps, Roma0 has the benefit of being perceptualy uniform.

Similar to MNE

plot_butterfly(results;positions=positions,extra=(;topoPositionToColorFunction=pos->UnfoldMakie.posToColorRGB(pos)))

HSV-Space

plot_butterfly(results;positions=positions,extra=(;topoPositionToColorFunction=UnfoldMakie.posToColorHSV))

Uniform Color

To highlight the flexibility, we can also make all lines gray, or any other arbitrary color, or function of electrode-position.

using Colors
-plot_butterfly(results;positions=positions,extra=(;topoPositionToColorFunction=x->Colors.RGB(0.5)))
+plot_butterfly(results;positions=positions,extra=(;topoPositionToColorFunction=x->Colors.RGB(0.5)))
diff --git a/dev/how_to/show_oob_labels/index.html b/dev/how_to/show_oob_labels/index.html index ad1d687ac..4113da4a3 100644 --- a/dev/how_to/show_oob_labels/index.html +++ b/dev/how_to/show_oob_labels/index.html @@ -1,5 +1,5 @@ -Show out of Bounds Label · UnfoldMakie.jl

Show out of Bounds Label

When visualizing a designmatrix it can happen that the labels on the y-axis get cut off towards the left (especially if they are quite long). In the following we discuss a possible quick fix for this problem.

Here we start off with the "label-limited" timeexpanded designmatrix from the corresponding How To section that details how it can be generated.

plot_designmatrix(designmatrix!(ufCont,evts),cDesign;setExtraValues=(xTicks=10, sortData=false))

#Label Limited Timeexpanded Designmatrix

While the plot automatically sets it's height accoring to the labels, they are cut off on the left side.

A quick fix would be to place an empty plot to the left of the designmatrix.

By creating your own figure with Makie.Figure, and then only giving a certain grid position to the designmatrix we get white space next to the plot.

The plot! function inside the plot config instance can take any grid position, and the figure f will include plot and sufficient white space next to it.

The exact numbers in the grid position can be guessed from the ratio of the overlap, or just tried out.

f = Figure()
+Show out of Bounds Label · UnfoldMakie.jl

Show out of Bounds Label

When visualizing a designmatrix it can happen that the labels on the y-axis get cut off towards the left (especially if they are quite long). In the following we discuss a possible quick fix for this problem.

Here we start off with the "label-limited" timeexpanded designmatrix from the corresponding How To section that details how it can be generated.

plot_designmatrix(designmatrix!(ufCont,evts),cDesign;setExtraValues=(xTicks=10, sortData=false))

#Label Limited Timeexpanded Designmatrix

While the plot automatically sets it's height accoring to the labels, they are cut off on the left side.

A quick fix would be to place an empty plot to the left of the designmatrix.

By creating your own figure with Makie.Figure, and then only giving a certain grid position to the designmatrix we get white space next to the plot.

The plot! function inside the plot config instance can take any grid position, and the figure f will include plot and sufficient white space next to it.

The exact numbers in the grid position can be guessed from the ratio of the overlap, or just tried out.

f = Figure()
 plot_design(f[1,2:6],designmatrix!(ufCont,evts),cDesign;setExtraValues=(xTicks=10, sortData=false))
 
-f

#Label Limited Timeexpanded Designmatrix

+f

#Label Limited Timeexpanded Designmatrix

diff --git a/dev/index.html b/dev/index.html index 599ac30fe..436db307b 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -UnfoldMakie Documentation · UnfoldMakie.jl

UnfoldMakie Documentation

This is the documentation of the UnfoldMakie module for the Julia programming language.

About

UnfoldMakie aims to allow users to generate different types of visualizations. These include line plots, butterfly plots, designmatrices, parallel coordinates plots, ERP images and topo plots. Building on the Unfold and Makie Modules, it also grants users customizability through an input configuration on the plots.

As is apparent considering the types of possible visualizations, these config options try to enable users to create plots, that are helpful in the subject area of computational EEG. One such example is the possibility of using a topo plot as a legend for a line plot by allowing for multiple visualizations within one figure.

Coordinated Multiple Views

Structure

For easy readability, the documentation is divided into sections users can inspect depending on their query.

The Tutorials: Setup section contains all information to get started including installation and how to aquire necessary data for testing if the user has none.

The Tutorials: Visualizations section summarizes all possible visualizations and how users can generate them. It also details their unique configuration options.

These visualizations are:

The Plot Configuration all segments of the config, detailing their contained attributes. The plot config is the prime interface allowing the user to access the different visualition options. As the options can be quite different in nature, the plot config is further split into categories. These segments are:

The How To section features information on how to achieve specific goals or deal with specific problems.

These segments are:

Used Packages

Everything was tested with Julia v1.7.

The following module in their respective versions are used internally by UnfoldMakie:

  • AlgebraOfGraphics v0.6.9
  • CairoMakie v0.8.9
  • Colors v0.12.8
  • ColorSchemes v3.19.0
  • DataFrames v1.3.4
  • GeometryBasics v0.4.2
  • ImageFiltering v0.7.1
  • Makie v0.17.9
  • Pipe v1.3.0
  • PyMNE v0.1.2
  • TopoPlots v0.1.0
  • Unfold v0.3.11
  • LinearAlgebra
  • SparseArrays
  • Statistics
+UnfoldMakie Documentation · UnfoldMakie.jl

UnfoldMakie Documentation

This is the documentation of the UnfoldMakie module for the Julia programming language.

About

UnfoldMakie aims to allow users to generate different types of visualizations. These include line plots, butterfly plots, designmatrices, parallel coordinates plots, ERP images and topo plots. Building on the Unfold and Makie Modules, it also grants users customizability through an input configuration on the plots.

As is apparent considering the types of possible visualizations, these config options try to enable users to create plots, that are helpful in the subject area of computational EEG. One such example is the possibility of using a topo plot as a legend for a line plot by allowing for multiple visualizations within one figure.

Coordinated Multiple Views

Structure

For easy readability, the documentation is divided into sections users can inspect depending on their query.

The Tutorials: Setup section contains all information to get started including installation and how to aquire necessary data for testing if the user has none.

The Tutorials: Visualizations section summarizes all possible visualizations and how users can generate them. It also details their unique configuration options.

These visualizations are:

The Plot Configuration all segments of the config, detailing their contained attributes. The plot config is the prime interface allowing the user to access the different visualition options. As the options can be quite different in nature, the plot config is further split into categories. These segments are:

The How To section features information on how to achieve specific goals or deal with specific problems.

These segments are:

Used Packages

Everything was tested with Julia v1.7.

The following module in their respective versions are used internally by UnfoldMakie:

  • AlgebraOfGraphics v0.6.9
  • CairoMakie v0.8.9
  • Colors v0.12.8
  • ColorSchemes v3.19.0
  • DataFrames v1.3.4
  • GeometryBasics v0.4.2
  • ImageFiltering v0.7.1
  • Makie v0.17.9
  • Pipe v1.3.0
  • PyMNE v0.1.2
  • TopoPlots v0.1.0
  • Unfold v0.3.11
  • LinearAlgebra
  • SparseArrays
  • Statistics
diff --git a/dev/literate/reference/positions.jl b/dev/literate/reference/positions.jl deleted file mode 100644 index 78ccf2d79..000000000 --- a/dev/literate/reference/positions.jl +++ /dev/null @@ -1,30 +0,0 @@ -using UnfoldMakie -using CairoMakie -using TopoPlots -using PyMNE - - -# # get MNE-positions -# Generate a fake MNE structure -# [taken from mne documentation](https://mne.tools/0.24/auto_examples/visualization/eeglab_head_sphere.html) - -biosemi_montage = PyMNE.channels.make_standard_montage("biosemi64") -n_channels = length(biosemi_montage.ch_names) -fake_info = PyMNE.create_info(ch_names=biosemi_montage.ch_names, sfreq=250., - ch_types="eeg") -data = rand(n_channels,1) * 1e-6 -fake_evoked = PyMNE.EvokedArray(data, fake_info) -fake_evoked.set_montage(biosemi_montage) - -pos = UnfoldMakie.toPositions(fake_evoked) - -# # project from 3D electrode locations to 2D -pos3d = hcat(values(pyconvert(Dict,biosemi_montage.get_positions()["ch_pos"]))...) - -pos2 = to_positions(pos3d) - -f = Figure(resolution=(600,300)) -scatter(f[1,1],pos3d[1:2,:]) -scatter(f[1,2],pos2) -f -# as one can see, the "naive" transform of just dropping the third dimension doesnt really work (left). We rather have to project the chanels to a sphere and unfold it (right) \ No newline at end of file diff --git a/dev/literate/reference/positions/index.html b/dev/literate/reference/positions/index.html deleted file mode 100644 index ce1a648ed..000000000 --- a/dev/literate/reference/positions/index.html +++ /dev/null @@ -1,22 +0,0 @@ - -Convert 3D positions / montages to 2D layouts · UnfoldMakie.jl
using UnfoldMakie
-using CairoMakie
-using TopoPlots
-using PyMNE
    CondaPkg Found dependencies: /home/runner/.julia/packages/PyMNE/HGgbW/CondaPkg.toml
-    CondaPkg Found dependencies: /home/runner/.julia/packages/PythonCall/qTEA1/CondaPkg.toml
-    CondaPkg Dependencies already up to date

get MNE-positions

Generate a fake MNE structure taken from mne documentation

biosemi_montage = PyMNE.channels.make_standard_montage("biosemi64")
-n_channels = length(biosemi_montage.ch_names)
-fake_info = PyMNE.create_info(ch_names=biosemi_montage.ch_names, sfreq=250.,
-                            ch_types="eeg")
-data = rand(n_channels,1) * 1e-6
-fake_evoked = PyMNE.EvokedArray(data, fake_info)
-fake_evoked.set_montage(biosemi_montage)
-
-pos = UnfoldMakie.toPositions(fake_evoked)

project from 3D electrode locations to 2D

pos3d = hcat(values(pyconvert(Dict,biosemi_montage.get_positions()["ch_pos"]))...)
-
-pos2 = to_positions(pos3d)
-
-f = Figure(resolution=(600,300))
-scatter(f[1,1],pos3d[1:2,:])
-scatter(f[1,2],pos2)
-f

as one can see, the "naive" transform of just dropping the third dimension doesnt really work (left). We rather have to project the chanels to a sphere and unfold it (right)


This page was generated using Literate.jl.

diff --git a/dev/literate/tutorials/circTopo/index.html b/dev/literate/tutorials/circTopo/index.html index 8c108c95d..412f6a63b 100644 --- a/dev/literate/tutorials/circTopo/index.html +++ b/dev/literate/tutorials/circTopo/index.html @@ -1,5 +1,5 @@ -Circular TopoPlot · UnfoldMakie.jl

Circular Topoplot Arrangement

using UnfoldMakie
+Circular TopoPlot · UnfoldMakie.jl

Circular Topoplot Arrangement

using UnfoldMakie
 using CairoMakie
 using TopoPlots # for example data
 using Random
@@ -9,4 +9,4 @@
     :estimate=>eachcol(Float64.(data[:,100:40:300,1])),
     :circularVariable=>[0,50,80,120,180,210],
     :time=>100:40:300)
-df = flatten(df,:estimate);

Our first plot!

note how the plots are at the angles of circularVariable`

plot_circulareegtopoplot(df;positions=pos,axis=(;label="Sac Incoming"),predictor=:circularVariable)

In case the bounding variable is not between 0 and 360, as here we use actually time, we have to specify it. e.g.

plot_circulareegtopoplot(df;positions=pos,axis=(;label="Time?!"),predictor=:time,extra=(;predictorBounds=[80,320]))

This page was generated using Literate.jl.

+df = flatten(df,:estimate);

Our first plot!

note how the plots are at the angles of circularVariable`

plot_circulareegtopoplot(df;positions=pos,axis=(;label="Sac Incoming"),predictor=:circularVariable)

In case the bounding variable is not between 0 and 360, as here we use actually time, we have to specify it. e.g.

plot_circulareegtopoplot(df;positions=pos,axis=(;label="Time?!"),predictor=:time,extra=(;predictorBounds=[80,320]))

This page was generated using Literate.jl.

diff --git a/dev/literate/tutorials/erp/index.html b/dev/literate/tutorials/erp/index.html index c96803d8a..101aeb4b6 100644 --- a/dev/literate/tutorials/erp/index.html +++ b/dev/literate/tutorials/erp/index.html @@ -1,5 +1,5 @@ -ERP plot · UnfoldMakie.jl

Line Plot Visualization

Here we discuss line plot visualization. Make sure you have looked into the installation instructions.

Include used Modules

The following modules are necessary for following this tutorial:

using Unfold
+ERP plot · UnfoldMakie.jl

Line Plot Visualization

Here we discuss line plot visualization. Make sure you have looked into the installation instructions.

Include used Modules

The following modules are necessary for following this tutorial:

using Unfold
 using UnfoldMakie
 using DataFrames
 using CairoMakie
@@ -24,4 +24,4 @@
 #		coefname=["(Intercept)","condition: face"] # if coefname not specified, line should be black
 #	)

plot_erp(results;extra= (;:pvalue=>pvals))

stderror (boolean)

Indicating whether the plot should show a colored band showing lower and higher estimates based on the stderror. Default is false.

previously we showed :stderror- but low/high is possible as well`

results.se_low = results.estimate .- 0.5
 results.se_high = results.estimate .+ 0.15
-plot_erp(select(results,Not(:stderror));extra= (;stderror=true))
Note

as in the above code,:stderror has precedence over :se_low/:se_high


This page was generated using Literate.jl.

+plot_erp(select(results,Not(:stderror));extra= (;stderror=true))
Note

as in the above code,:stderror has precedence over :se_low/:se_high


This page was generated using Literate.jl.

diff --git a/dev/search/index.html b/dev/search/index.html index af56ac965..ab930b776 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · UnfoldMakie.jl

Loading search...

    +Search · UnfoldMakie.jl

    Loading search...

      diff --git a/dev/search_index.js b/dev/search_index.js index d517ee5d4..2b26f1a12 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"how_to/show_oob_labels/#ht_soobl","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"","category":"section"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"When visualizing a designmatrix it can happen that the labels on the y-axis get cut off towards the left (especially if they are quite long). In the following we discuss a possible quick fix for this problem.","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"Here we start off with the \"label-limited\" timeexpanded designmatrix from the corresponding How To section that details how it can be generated.","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"plot_designmatrix(designmatrix!(ufCont,evts),cDesign;setExtraValues=(xTicks=10, sortData=false))","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"#(Image: Label Limited Timeexpanded Designmatrix)","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"While the plot automatically sets it's height accoring to the labels, they are cut off on the left side.","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"A quick fix would be to place an empty plot to the left of the designmatrix.","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"By creating your own figure with Makie.Figure, and then only giving a certain grid position to the designmatrix we get white space next to the plot.","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"The plot! function inside the plot config instance can take any grid position, and the figure f will include plot and sufficient white space next to it.","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"The exact numbers in the grid position can be guessed from the ratio of the overlap, or just tried out.","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"f = Figure()\nplot_design(f[1,2:6],designmatrix!(ufCont,evts),cDesign;setExtraValues=(xTicks=10, sortData=false))\n\nf","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"#(Image: Label Limited Timeexpanded Designmatrix)","category":"page"},{"location":"config/legend_data/#config_legend","page":"Legend Data","title":"Legend Data","text":"","category":"section"},{"location":"config/legend_data/","page":"Legend Data","title":"Legend Data","text":"The legend data of the configuration consists of config options for the legend. ","category":"page"},{"location":"config/legend_data/#Line-Plots-and-Butterfly-Plots","page":"Legend Data","title":"Line Plots and Butterfly Plots","text":"","category":"section"},{"location":"config/legend_data/","page":"Legend Data","title":"Legend Data","text":"For line plots the legend! function of the AlgebraOfGraphics module is used (documentation).","category":"page"},{"location":"config/legend_data/","page":"Legend Data","title":"Legend Data","text":"The Legend will be used automatically, when AlgebraOfGraphics is able to draw it. For this the color data will be used and has to be either non-numerical or funcall(...;extra=(categoricalColor=true,) needs to be set true.","category":"page"},{"location":"config/legend_data/#Parallel-Coordinates-Plots","page":"Legend Data","title":"Parallel Coordinates Plots","text":"","category":"section"},{"location":"config/legend_data/","page":"Legend Data","title":"Legend Data","text":"In a parallel coordinate plot the Legend function of the Makie module is used (documentation).","category":"page"},{"location":"config/legend_data/","page":"Legend Data","title":"Legend Data","text":"The Legend will only be used when funcall(...;layout=(showLegend=true,) is true and funcall(...;layout=(useColorbar=false,) is false","category":"page"},{"location":"config/legend_data/#Legend-data-default-options","page":"Legend Data","title":"Legend data default options","text":"","category":"section"},{"location":"config/legend_data/","page":"Legend Data","title":"Legend Data","text":"orientation = :vertical\ntellwidth = true\ntellheight = true","category":"page"},{"location":"config/extra_data/#config_extra","page":"Extra Data","title":"Extra Data","text":"","category":"section"},{"location":"config/extra_data/","page":"Extra Data","title":"Extra Data","text":"The extra data of the configuration consists of all config options that are unique for the visualizations.","category":"page"},{"location":"config/extra_data/","page":"Extra Data","title":"Extra Data","text":"The available options for each plot are described at the end of their respective tutorial in the Tutorials: Visualizations section.","category":"page"},{"location":"config/axis_data/#config_axis","page":"Axis Data","title":"Axis Data","text":"","category":"section"},{"location":"config/axis_data/","page":"Axis Data","title":"Axis Data","text":"The axis data of the configuration consists of config options for the axis. ","category":"page"},{"location":"config/axis_data/","page":"Axis Data","title":"Axis Data","text":"The input of this config is directly fed into the Axis function of the Makie module. As a consequence, the possible options are also determined by the function. Details for these options can be found in the corresponding article of the Makie documentation.","category":"page"},{"location":"how_to/position2color/#ht_p2c","page":"Butterfly Colormap","title":"Change Butterfly Channel Position Color","text":"","category":"section"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"In this section we discuss how users are able change the position to colorscale of the legendtopo in the butterfly plot.","category":"page"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"using UnfoldMakie\nusing CairoMakie\nusing DataFramesMeta","category":"page"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"By default the plot looks like this:","category":"page"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"include(\"../../example_data.jl\")\nresults,positions = example_data(\"TopoPlots.jl\")\nplot_butterfly(results;positions=positions)","category":"page"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"We can switch the colorscale of the position-map, by giving a function that maps from a (x,y) tuple to a color. UnfoldMakie currently provides three different ones pos2colorRGB (same as MNE-Python), pos2colorHSV (HSV colorspace), pos2colorRomaO. Whereas RGB & HSV have the benefits of being 2D colormaps, Roma0 has the benefit of being perceptualy uniform.","category":"page"},{"location":"how_to/position2color/#Similar-to-MNE","page":"Butterfly Colormap","title":"Similar to MNE","text":"","category":"section"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"plot_butterfly(results;positions=positions,extra=(;topoPositionToColorFunction=pos->UnfoldMakie.posToColorRGB(pos)))","category":"page"},{"location":"how_to/position2color/#HSV-Space","page":"Butterfly Colormap","title":"HSV-Space","text":"","category":"section"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"plot_butterfly(results;positions=positions,extra=(;topoPositionToColorFunction=UnfoldMakie.posToColorHSV))","category":"page"},{"location":"how_to/position2color/#Uniform-Color","page":"Butterfly Colormap","title":"Uniform Color","text":"","category":"section"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"To highlight the flexibility, we can also make all lines gray, or any other arbitrary color, or function of electrode-position.","category":"page"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"using Colors\nplot_butterfly(results;positions=positions,extra=(;topoPositionToColorFunction=x->Colors.RGB(0.5)))","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"EditURL = \"erp.jl\"","category":"page"},{"location":"literate/tutorials/erp/#lp_vis","page":"ERP plot","title":"Line Plot Visualization","text":"","category":"section"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"Here we discuss line plot visualization. Make sure you have looked into the installation instructions.","category":"page"},{"location":"literate/tutorials/erp/#Include-used-Modules","page":"ERP plot","title":"Include used Modules","text":"","category":"section"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"The following modules are necessary for following this tutorial:","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"using Unfold\nusing UnfoldMakie\nusing DataFrames\nusing CairoMakie\nusing DataFramesMeta\nusing UnfoldSim\nusing UnfoldMakie","category":"page"},{"location":"literate/tutorials/erp/#Setup","page":"ERP plot","title":"Setup","text":"","category":"section"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"Let's generate some data and fit a model of a 2-level categorical and a continuous predictor with interaction.","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"data,evts = UnfoldSim.predef_eeg(;noiselevel=12,return_epoched=true)\ndata = reshape(data,(1,size(data)...))\nf = @formula 0 ~ 1+condition+continuous\nse_solver =(x,y)->Unfold.solver_default(x,y,stderror=true);\n\nm = fit(UnfoldModel, Dict(Any=>(f,range(0,step=1/100,length=size(data,2)))), evts, data,solver=se_solver)\nresults = coeftable(m)\nres_effects = effects(Dict(:continuous=>-5:0.5:5),m);\nnothing #hide","category":"page"},{"location":"literate/tutorials/erp/#Plot-the-results","page":"ERP plot","title":"Plot the results","text":"","category":"section"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"plot_erp(results; extra=(:stderror=>true,))","category":"page"},{"location":"literate/tutorials/erp/#Column-Mappings-for-Line-Plots","page":"ERP plot","title":"Column Mappings for Line Plots","text":"","category":"section"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"plot_erp use a DataFrame as an input, the library needs to know the names of the columns used for plotting.","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"There are multiple default values, that are checked in that order if they exist in the DataFrame, a custom name can be chosen using plot_erp(...;mapping=(; :y=:myEstimate)","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":":x Default is (:x, :time). :y Default is (:y, :estimate, :yhat). :color Default is (:color, :coefname).","category":"page"},{"location":"literate/tutorials/erp/#Configuration-for-Line-Plots","page":"ERP plot","title":"Configuration for Line Plots","text":"","category":"section"},{"location":"literate/tutorials/erp/#extra","page":"ERP plot","title":"extra","text":"","category":"section"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"plot_erp(...;extra=(;=,...).","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"categoricalColor (boolean, true) - in case of numeric :color column, is color a continuous or categorical variable?\ncategoricalGroup (boolean, true) - in case of numeric :group column, treat :group as categorical variable by default\nstderror (boolean, false) - add an error-ribbon based on the :stderror column\npvalue (see below)","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"Using some general configurations we can pretty up the default visualization. Here we use the following configuration:","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"plot_erp(res_effects;\n mapping = (;y=:yhat,color=:continuous, group=:continuous),\n extra=(;showLegend=true,\n categoricalColor=false,\n categoricalGroup=true),\n legend = (;nbanks=2),\n layout = (;legendPosition=:right))","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"In the following we will use this \"pretty\" line plot as a basis for looking into configuration options.","category":"page"},{"location":"literate/tutorials/erp/#pvalue-(array)","page":"ERP plot","title":"pvalue (array)","text":"","category":"section"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"important: Important\nthis is currently broken!","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"Is an array of p-values. If array not empty, plot shows colored lines under the plot representing the p-values. Default is [] (an empty array). Shown below is an example in which pvalue are given: pvals = DataFrame(","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"#\t\tfrom=[0.1,0.3],\n#\t\tto=[0.5,0.7],\n#\t\tcoefname=[\"(Intercept)\",\"condition: face\"] # if coefname not specified, line should be black\n#\t)","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"plot_erp(results;extra= (;:pvalue=>pvals))","category":"page"},{"location":"literate/tutorials/erp/#stderror-(boolean)","page":"ERP plot","title":"stderror (boolean)","text":"","category":"section"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"Indicating whether the plot should show a colored band showing lower and higher estimates based on the stderror. Default is false.","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"previously we showed :stderror- but low/high is possible as well`","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"results.se_low = results.estimate .- 0.5\nresults.se_high = results.estimate .+ 0.15\nplot_erp(select(results,Not(:stderror));extra= (;stderror=true))","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"note: Note\nas in the above code,:stderror has precedence over :se_low/:se_high","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"This page was generated using Literate.jl.","category":"page"},{"location":"config/visual_data/#config_visual","page":"Visual Data","title":"Visual Data","text":"","category":"section"},{"location":"config/visual_data/","page":"Visual Data","title":"Visual Data","text":"The visual data of the configuration will be passed to the underlying plotting functions and can be used to set their specific attributes.","category":"page"},{"location":"config/visual_data/","page":"Visual Data","title":"Visual Data","text":"As a consequence, the possible options are determined by the following functions:","category":"page"},{"location":"config/visual_data/","page":"Visual Data","title":"Visual Data","text":"Designmatrix, ERP Image : heatmap (documentation)\nLine Plot, Butterfly Plot, PCP : lines (documentation)\nTopo Plot, EEG Topo Plot : topoplot,eeg_topoplot (documentation)","category":"page"},{"location":"config/colorbar_data/#config_colorbar","page":"Colorbar Data","title":"Colorbar Data","text":"","category":"section"},{"location":"config/colorbar_data/","page":"Colorbar Data","title":"Colorbar Data","text":"The colorbar data of the configuration consists of config options for the colorbar that can be used as a legend. As a consequence, the possible options are determined by the underlying functions.","category":"page"},{"location":"config/colorbar_data/#ERP-Plots","page":"Colorbar Data","title":"ERP Plots","text":"","category":"section"},{"location":"config/colorbar_data/","page":"Colorbar Data","title":"Colorbar Data","text":"For ERP plots, the colorbar! function of the AlgebraOfGraphics module is used (documentation).","category":"page"},{"location":"config/colorbar_data/","page":"Colorbar Data","title":"Colorbar Data","text":"The Colorbar will be automatically used, when AlgebraOfGraphics is able to draw it. For this, the color data will be used and has to be numerical. Furthermore extra=(;categoricalColor=false) needs to be false.","category":"page"},{"location":"config/colorbar_data/#Other-Plots","page":"Colorbar Data","title":"Other Plots","text":"","category":"section"},{"location":"config/colorbar_data/","page":"Colorbar Data","title":"Colorbar Data","text":"In all other Plots the Colorbar function of the Makie module is used (documentation).","category":"page"},{"location":"config/colorbar_data/","page":"Colorbar Data","title":"Colorbar Data","text":"The Colorbar will only be used when both layoutData.showLegend and layoutData.useColorbar are set true.","category":"page"},{"location":"config/colorbar_data/#Colorbar-data-default-values","page":"Colorbar Data","title":"Colorbar data default values","text":"","category":"section"},{"location":"config/colorbar_data/","page":"Colorbar Data","title":"Colorbar Data","text":"vertical = true\ntellwidth = true\ntellheight = true","category":"page"},{"location":"how_to/fix_pcp/#ht_fpcp","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"","category":"section"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"Since Makie didn't have a native function to draw PCPs our version is somewhat experimental for broad applications.","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"Under certain circumstances the PCP is not properly visualized. This leads to cut off edges of the PCP, and unused space.","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"Especially when changing the container size by customizing the figure resolution, or adding multiple plots into one figure, the PCP can have problems fitting inside.","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"(Image: PCP with cutoff and bad spacing)","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"We can set some variables to fix these issues using","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"paraConfig.setExtraValues(\n ...\n)","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"Since the plot could have more space above and below, we can change the aspect ratio of the plot with:","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"...\npc_aspect_ratio = 1,\n...","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"The cut off or overlap at each side can be fixed with:","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"...\npc_right_padding = 15,\npc_left_padding = 45,\npc_top_padding = 50,\npc_bottom_padding = 27,\n...","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"Furthermore, if the tick-number size becomes too big or small it can be changed with:","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"...\npc_tick_label_size = 25,\n...","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"By setting these manually through trial and error we can fix the visualization issues:","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"(Image: Fixed PCP)","category":"page"},{"location":"config/mapping_data/#config_mapping","page":"Mapping Data","title":"Mapping Data","text":"","category":"section"},{"location":"config/mapping_data/","page":"Mapping Data","title":"Mapping Data","text":"The mapping data of the configuration is used to let the plotting functions know which columns of a DataFrame contain which data. Therefore it is only used in plots with a DataFrame as input.","category":"page"},{"location":"config/mapping_data/","page":"Mapping Data","title":"Mapping Data","text":"For example a Line Plot makes use of the x and y mappings. To have our Line Plot use the \"estimate\" column for x and the \"time\" column for y we can use:","category":"page"},{"location":"config/mapping_data/","page":"Mapping Data","title":"Mapping Data","text":"plot_erp(...;mapping=(;x=:estimate,))\n","category":"page"},{"location":"config/mapping_data/","page":"Mapping Data","title":"Mapping Data","text":"Which columns are used by which plotting function can be looked up in their respective tutorials in the Tutorials: Visualizations section.","category":"page"},{"location":"config/mapping_data/#Multiple-Options","page":"Mapping Data","title":"Multiple Options","text":"","category":"section"},{"location":"config/mapping_data/","page":"Mapping Data","title":"Mapping Data","text":"In addition to providing a single column which contains the specified data, the user can also provide a list of columns which may contain the data.","category":"page"},{"location":"config/mapping_data/","page":"Mapping Data","title":"Mapping Data","text":"plot_erp(...;mapping=(;y = (:y, :yhat, :estimate)))","category":"page"},{"location":"config/mapping_data/","page":"Mapping Data","title":"Mapping Data","text":"In this case the first available column will be chosen.","category":"page"},{"location":"config/mapping_data/","page":"Mapping Data","title":"Mapping Data","text":"Some configurations for certain plots already have a default column or a list of columns set. This way the user might not need to set any mapping values themselves, in case the DataFrame conforms to the same standards.","category":"page"},{"location":"how_to/mult_vis_in_fig/#ht_mvf","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"","category":"section"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"using UnfoldMakie\nusing CairoMakie\nusing DataFramesMeta\nusing UnfoldSim\nusing Unfold\nusing MakieThemes\nset_theme!(theme_ggthemr(:fresh)) # nicer defaults - should maybe be default?\n","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"include(\"../../example_data.jl\")\nd_topo, positions = example_data(\"TopoPlots.jl\")\nuf_deconv = example_data(\"UnfoldLinearModelContinuousTime\")\nuf = example_data(\"UnfoldLinearModel\")\nresults = coeftable(uf)\nuf_5chan = example_data(\"UnfoldLinearModelMultiChannel\")\nd_singletrial, _ = UnfoldSim.predef_eeg(; return_epoched=true)\nnothing #hide","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"In this section we discuss how users are able to include multiple visualizations in a single figure.","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"By using the !-version of the plotting function and putting in a grid position instead of a full figure, we can create Multiple Coordinated Views.","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"You start by creating a figure with Makie.Figure. ","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"f = Figure()","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"Now each plot can be added to f by putting in a grid position, such as f[1,1].","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"\nf = Figure()\nplot_erp!(f[1, 1], coeftable(uf_deconv))\nplot_erp!(f[1, 2], effects(Dict(:condition => [\"car\", \"face\"]), uf_deconv), mapping=(; color=:condition))\nplot_butterfly!(f[2, 1:2], d_topo; positions=positions)\n\nf","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"By using the data from the tutorials we can create a big image with every type of plot.","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"With so many plots at once it's incentivised to set a fixed resolution in your figure to order the plots evenly (Code below).","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"\nf = Figure(resolution=(2000, 2000))\n\nplot_butterfly!(f[1, 1:3], d_topo; positions=positions)\n\npvals = DataFrame(\n from=[0.1, 0.15],\n to=[0.2, 0.5],\n # if coefname not specified, line should be black\n coefname=[\"(Intercept)\", \"category: face\"]\n)\nplot_erp!(f[2, 1:2], results, extra=(;\n categoricalColor=false,\n categoricalGroup=false,\n pvalue=pvals,\n stderror=true))\n\n\nplot_designmatrix!(f[2, 3], designmatrix(uf))\n\n#plot_designmatrix!(f[2,4], designmatrix(uf_deconv);visual=(;colormap=:inferno))\n\nplot_topoplot!(f[3, 1], collect(1:64); positions=positions, visual=(; colormap=:viridis))\nplot_topoplotseries!(f[4, 1:3], d_topo, 0.1; positions=positions, mapping=(; label=:channel))\n\n\nres_effects = effects(Dict(:continuous => -5:0.5:5), uf_deconv)\n\nplot_erp!(f[2, 4:5], res_effects;\n mapping=(; y=:yhat, color=:continuous, group=:continuous),\n extra=(; showLegend=true,\n categoricalColor=false,\n categoricalGroup=true),\n legend=(; nbanks=2),\n layout=(; legendPosition=:right))\n\n\n\nplot_parallelcoordinates!(f[3, 2:3], uf_5chan, [1, 2, 3, 4, 5]; mapping=(; color=:coefname), layout=(; legendPosition=:bottom))\n\nplot_erpimage!(f[1, 4:5], d_singletrial)\nplot_circulareegtopoplot!(f[3:4, 4:5], d_topo[in.(d_topo.time, Ref(-0.3:0.1:0.5)), :]; \n positions=positions, predictor=:time, extra=(; predictorBounds=[-0.3, 0.5]))\n\nf","category":"page"},{"location":"tutorials/topoplotseries/#tpseries_vis","page":"Topo Plot Series","title":"Topo Plot SeriesVisualization","text":"","category":"section"},{"location":"tutorials/topoplotseries/#Include-used-Modules","page":"Topo Plot Series","title":"Include used Modules","text":"","category":"section"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"The following modules are necessary for following this tutorial:","category":"page"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"using Unfold\nusing UnfoldMakie\nusing DataFrames\nusing CairoMakie\nusing TopoPlots","category":"page"},{"location":"tutorials/topoplotseries/#Plot-Topo-Plots-Series","page":"Topo Plot Series","title":"Plot Topo Plots Series","text":"","category":"section"},{"location":"tutorials/topoplotseries/#Giving-the-Data","page":"Topo Plot Series","title":"Giving the Data","text":"","category":"section"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"In case you do not already have data, you can get example data from the TopoPlots module. You can do it like this:","category":"page"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"data, positions = TopoPlots.example_data()\ndf = UnfoldMakie.eeg_matrix_to_dataframe(data[:,:,1], string.(1:length(positions)));\nnothing #hide","category":"page"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"Δbin = 80\nplot_topoplotseries(df, Δbin; positions = positions)","category":"page"},{"location":"tutorials/topoplotseries/#Positions","page":"Topo Plot Series","title":"Positions","text":"","category":"section"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"You can give either positions, or labels. If both are provided, positions have priority","category":"page"},{"location":"tutorials/topoplotseries/#plot_toposeries(...;mapping(;keyvalue))","page":"Topo Plot Series","title":"plot_toposeries(...;mapping=(;key=value))","text":"","category":"section"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"mapping=(:y=(:estimate,:yhat,:y))","category":"page"},{"location":"tutorials/topoplotseries/#visual(;)","page":"Topo Plot Series","title":"visual=(;)","text":"","category":"section"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"label_text (boolean, false) Indicates whether label should drawn next to their position. The labels have to be given into the function seperately:","category":"page"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"important: Important\ncurrently bugged","category":"page"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"label_scatter (boolean, true) - Indicates whether the dots should be drawn at the given positions.","category":"page"},{"location":"config/layout_data/#config_layout","page":"Layout Data","title":"Layout Data","text":"","category":"section"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"The layout data of the configuration consists of config options for the layout such as the legend and labels.","category":"page"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"The following layout data options exist (the default values may be different for some plots types):","category":"page"},{"location":"config/layout_data/#showLegend-(boolean)","page":"Layout Data","title":"showLegend (boolean)","text":"","category":"section"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"Indicating whether the legend is displayed. Default is true.","category":"page"},{"location":"config/layout_data/#legendPostion-(Symbol)","page":"Layout Data","title":"legendPostion (Symbol)","text":"","category":"section"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"Indicating the position and orientation of the legend. Possible values are :right and :bottom. Default is :right.","category":"page"},{"location":"config/layout_data/#useColorbar-(boolean)","page":"Layout Data","title":"useColorbar (boolean)","text":"","category":"section"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"Indicating whether the colorbar should be used. Default is false.","category":"page"},{"location":"config/layout_data/#xlabelFromMapping-(Symbol/Nothing)","page":"Layout Data","title":"xlabelFromMapping (Symbol/Nothing)","text":"","category":"section"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"Which data column should be used for the xlabel. Set to nothing if no column name should be used. Default is :x.","category":"page"},{"location":"config/layout_data/#ylabelFromMapping-(Symbol/Nothing)","page":"Layout Data","title":"ylabelFromMapping (Symbol/Nothing)","text":"","category":"section"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"Which data column should be used for the ylabel. Set to nothing if no column name should be used. Default is :y.","category":"page"},{"location":"config/layout_data/#other-Makie-functions","page":"Layout Data","title":"other Makie functions","text":"","category":"section"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"In addition to the previous options the hidespines! and hidedecorations! functions from the Makie module can be enabled by setting their respective parameters as follows.","category":"page"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"config.setLayoutValues(\n ...\n hidespines = (:r, :t),\n hidedecorations = ()\n)","category":"page"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"Setting them to nothing will disable them. More information on how to use them can be found in this HowTo","category":"page"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"EditURL = \"circTopo.jl\"","category":"page"},{"location":"literate/tutorials/circTopo/#Circular-Topoplot-Arrangement","page":"Circular TopoPlot","title":"Circular Topoplot Arrangement","text":"","category":"section"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"using UnfoldMakie\nusing CairoMakie\nusing TopoPlots # for example data\nusing Random\nusing DataFrames","category":"page"},{"location":"literate/tutorials/circTopo/#Generate-data","page":"Circular TopoPlot","title":"Generate data","text":"","category":"section"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"Generate a Dataframe. We need to specify the TopoPlot Positions either via position, or via labels (according to TopoPlots.jl)","category":"page"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"data,pos = TopoPlots.example_data();\ndat = data[:, 240, 1]\ndf= DataFrame(\n :estimate=>eachcol(Float64.(data[:,100:40:300,1])),\n :circularVariable=>[0,50,80,120,180,210],\n :time=>100:40:300)\ndf = flatten(df,:estimate);\nnothing #hide","category":"page"},{"location":"literate/tutorials/circTopo/#Our-first-plot!","page":"Circular TopoPlot","title":"Our first plot!","text":"","category":"section"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"note how the plots are at the angles of circularVariable`","category":"page"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"plot_circulareegtopoplot(df;positions=pos,axis=(;label=\"Sac Incoming\"),predictor=:circularVariable)","category":"page"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"In case the bounding variable is not between 0 and 360, as here we use actually time, we have to specify it. e.g.","category":"page"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"plot_circulareegtopoplot(df;positions=pos,axis=(;label=\"Time?!\"),predictor=:time,extra=(;predictorBounds=[80,320]))","category":"page"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"","category":"page"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"This page was generated using Literate.jl.","category":"page"},{"location":"tutorials/parallelcoordinates/#pcp_vis","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"Here we discuss parallel coordinates plot (PCP) visualization. ","category":"page"},{"location":"tutorials/parallelcoordinates/#Include-used-Modules","page":"Parallel Coordinates Plot","title":"Include used Modules","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"The following modules are necessary for following this tutorial:","category":"page"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"using Unfold\nusing UnfoldMakie\nusing DataFrames\nusing CairoMakie","category":"page"},{"location":"tutorials/parallelcoordinates/#Data","page":"Parallel Coordinates Plot","title":"Data","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"In case you do not already have data, look at the Load Data section. ","category":"page"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"We use the test data of erpcore-N170.jld2.","category":"page"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"include(\"../../example_data.jl\")\nresults_plot, positions = example_data();","category":"page"},{"location":"tutorials/parallelcoordinates/#Plot-PCPs","page":"Parallel Coordinates Plot","title":"Plot PCPs","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"plot_parallelcoordinates(results_plot,[5,3,2]; # this selects channel 5,3 & 2 \n mapping = (color = :coefname, y = :estimate))","category":"page"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"important: Important\nthe following is still outdated...","category":"page"},{"location":"tutorials/parallelcoordinates/#Column-Mappings-for-PCPs","page":"Parallel Coordinates Plot","title":"Column Mappings for PCPs","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"Since PCPs use a DataFrame as an input, the library needs to know the names of the columns used for plotting.","category":"page"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"For more informations about mapping values, look into the Mapping Data section of the documentation.","category":"page"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"While there are multiple default values that are checked in that order if they exist in the DataFrame, a custom name might need to be choosen for:","category":"page"},{"location":"tutorials/parallelcoordinates/#y","page":"Parallel Coordinates Plot","title":"y","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"Default is (:y, :estimate, :yhat).","category":"page"},{"location":"tutorials/parallelcoordinates/#channel","page":"Parallel Coordinates Plot","title":"channel","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"Default is :channel.","category":"page"},{"location":"tutorials/parallelcoordinates/#color","page":"Parallel Coordinates Plot","title":"color","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"XXX Default is :coef.","category":"page"},{"location":"tutorials/parallelcoordinates/#time","page":"Parallel Coordinates Plot","title":"time","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"Default is :time.","category":"page"},{"location":"tutorials/erpimage/#erpi_vis","page":"ERP Image","title":"ERP Image Visualization","text":"","category":"section"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"Here we discuss ERP image visualization. Make sure you have looked into the installation instructions.","category":"page"},{"location":"tutorials/erpimage/#Include-used-Modules","page":"ERP Image","title":"Include used Modules","text":"","category":"section"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"The following modules are necessary for following this tutorial:","category":"page"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"using Unfold\nusing UnfoldMakie\nusing CairoMakie\nusing UnfoldSim\ninclude(\"../../example_data.jl\")","category":"page"},{"location":"tutorials/erpimage/#Plot-ERP-Images","page":"ERP Image","title":"Plot ERP Images","text":"","category":"section"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"The following code will result in the default configuration. ","category":"page"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"data, evts = UnfoldSim.predef_eeg(; noiselevel=10, return_epoched=true)\nplot_erpimage(data)","category":"page"},{"location":"tutorials/erpimage/#Column-Mappings-for-ERP-Images","page":"ERP Image","title":"Column Mappings for ERP Images","text":"","category":"section"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"Since ERP images use a Matrix as an input, the library does not need any informations about the mapping.","category":"page"},{"location":"tutorials/erpimage/#extra(;)","page":"ERP Image","title":"extra=(;)","text":"","category":"section"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"erpBlur (number,10 ) - Is a number indicating how much blur is applied to the image; using Gaussian blur of the ImageFiltering module. Negative values deactivate the blur.\nsortData (boolean,false) - Indicating whether the data is sorted; using sortperm() of Base Julia ","category":"page"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"(sortperm() computes a permutation of the array's indices that puts the array into sorted order). ","category":"page"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"ploterp (bool, false) - Indicating whether the plot should add a line plot below the ERP image, showing the mean of the data. If limits are set in the axis values both plots will be aligned.","category":"page"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"plot_erpimage(data;\n extra = (ploterp = true,),\n colorbar = (label = \"Voltage [µV]\",),\n visual = (colormap = :viridis, colorrange = (-40, 40)))\n","category":"page"},{"location":"tutorials/butterfly/#bfp_vis","page":"Butterfly Plot","title":"Butterfly Plot Visualization","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Here we discuss butterfly plot visualization. Make sure you have looked into the installation instructions.","category":"page"},{"location":"tutorials/butterfly/#Include-used-Modules","page":"Butterfly Plot","title":"Include used Modules","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"The following modules are necessary for following this tutorial:","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"using UnfoldMakie\nusing Unfold\nusing CairoMakie\nusing DataFrames","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Note that DataFramesMeta is also used here in order to be able to use @subset for testing (filtering).","category":"page"},{"location":"tutorials/butterfly/#Data","page":"Butterfly Plot","title":"Data","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"In case you want to try with different data, look at the Load Data section. ","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"We filter the data to make it more clearly represented:","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"include(\"../../example_data.jl\")\ndf, pos = example_data(\"TopoPlots.jl\")\nfirst(df,3)","category":"page"},{"location":"tutorials/butterfly/#Plot-Butterfly-Plots","page":"Butterfly Plot","title":"Plot Butterfly Plots","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"The following code will plot the default butterfly plot","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"plot_butterfly(df)","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"or if you provide the channel positions:","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"plot_butterfly(df;positions=pos)","category":"page"},{"location":"tutorials/butterfly/#Column-Mappings-for-Butterfly-Plots","page":"Butterfly Plot","title":"Column Mappings for Butterfly Plots","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Since butterfly plots use a DataFrame as an input, the library needs to know the names of the columns used for plotting. You can set these mapping values by plot_butterfly(...; mapping=(;:x=:time,)), that is, providing a NamedTuple (note the ; just after the opening-brackets","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"For more information about mapping values look into the Mapping Data section of the documentation.","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"While there are multiple default values, that are checked in that order if they exist in the DataFrame, a custom name might need to be choosen for:","category":"page"},{"location":"tutorials/butterfly/#x","page":"Butterfly Plot","title":"x","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Default is (:x, :time).","category":"page"},{"location":"tutorials/butterfly/#y","page":"Butterfly Plot","title":"y","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Default is (:y, :estimate, :yhat).","category":"page"},{"location":"tutorials/butterfly/#labels","page":"Butterfly Plot","title":"labels","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Default is (:labels, :label, :topoLabels, :sensor, :nothing)","category":"page"},{"location":"tutorials/butterfly/#Configurations-for-Butterfly-Plots","page":"Butterfly Plot","title":"Configurations for Butterfly Plots","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Here we look into possible options for configuring the butterfly plot visualization using (...;extra=(=,...). This is the list of unique configuration (extraData):","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"topoLegend (boolean)","category":"page"},{"location":"tutorials/butterfly/#topoLegend-(boolean)","page":"Butterfly Plot","title":"topoLegend (boolean)","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Indicating whether the topo legend is displayed. Default is true.","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"For more general options look into the Plot Configuration section of the documentation.","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Since the configurations for line plots can be applied to butterfly plots as well. Here you can find the configurations for line plots, ","category":"page"},{"location":"tutorials/topoplot/#tp_vis","page":"Topo Plot","title":"Topo Plot Visualization","text":"","category":"section"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"Here we discuss topo plot visualization. Make sure you have looked into the installation instructions.","category":"page"},{"location":"tutorials/topoplot/#Include-used-Modules","page":"Topo Plot","title":"Include used Modules","text":"","category":"section"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"The following modules are necessary for following this tutorial:","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"using Unfold\nusing UnfoldMakie\nusing DataFrames\nusing CairoMakie\nusing TopoPlots","category":"page"},{"location":"tutorials/topoplot/#Plot-Topo-Plots","page":"Topo Plot","title":"Plot Topo Plots","text":"","category":"section"},{"location":"tutorials/topoplot/#Providing-the-Data","page":"Topo Plot","title":"Providing the Data","text":"","category":"section"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"data, positions = TopoPlots.example_data()","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"We select one datapoint, and the first enry of dimension 3 (the mean estimate, the others are p-value and std)","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"plot_topoplot(data[:,340,1]; positions = positions)","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"using DataFrames\ndf = DataFrame(:estimate => data[:,340,1])\nplot_topoplot(df; positions = positions)","category":"page"},{"location":"tutorials/topoplot/#Giving-the-Positions","page":"Topo Plot","title":"Giving the Positions","text":"","category":"section"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"Since the topo plot needs the positions of the sensors they have to be put into the drawing function. But there are multiple options (In order of prioritization):","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"Giving the positions directly: plot_topoplot(...; positions=[...])\nGiving the labels of the sensors: plot_topoplot(...; labels=[...])","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"To get the positions from the labels we use a database.","category":"page"},{"location":"tutorials/topoplot/#Column-Mappings-for-Topo-Plots","page":"Topo Plot","title":"Column Mappings for Topo Plots","text":"","category":"section"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"When using topo plots with a DataFrame as an input, the library needs to know the names of the columns used for plotting.","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"For more informations about mapping values look into the Mapping Data section of the documentation.","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"While there are multiple default values, that are checked in that order if they exist in the DataFrame, a custom name might need to be choosen for:","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"Note that only one of positions or labels have to be set to draw a topo plot. If both are set, positions takes precedence, labels might be used for labelling electrodes in TopoPlots.jl","category":"page"},{"location":"tutorials/topoplot/#(...,mapping(;))","page":"Topo Plot","title":"(...,mapping=(;))","text":"","category":"section"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":":y plotting function looks in the default columns of mapping","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"cfgDefault = UnfoldMakie.PlotConfig()\ncfgDefault.mapping.y","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"positions","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"cfgDefault.mapping.positions #hide","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"labels","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"cfgDefault.mapping.labels #hide","category":"page"},{"location":"tutorials/topoplot/#label_text-(boolean)","page":"Topo Plot","title":"label_text (boolean)","text":"","category":"section"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"Indicates whether label should drawn next to their position. Obviously the labels have to be provided: plot_topoplot(...; labels=[...])","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"plot_topoplot(...;visual=(;label_text=true))","category":"page"},{"location":"tutorials/topoplot/#label_scatter-(boolean)","page":"Topo Plot","title":"label_scatter (boolean)","text":"","category":"section"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"Indicates whether the dots should be drawn at the given positions.","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"plot_topoplot(...;visual=(;label_scatter=true))","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"data, positions = TopoPlots.example_data()\nplot_topoplot(data[1:4,340,1]; visual = (; label_scatter = false), labels=[\"O1\", \"F2\", \"F3\", \"P4\"])","category":"page"},{"location":"literate/reference/positions/","page":"Convert 3D positions / montages to 2D layouts","title":"Convert 3D positions / montages to 2D layouts","text":"EditURL = \"positions.jl\"","category":"page"},{"location":"literate/reference/positions/","page":"Convert 3D positions / montages to 2D layouts","title":"Convert 3D positions / montages to 2D layouts","text":"using UnfoldMakie\nusing CairoMakie\nusing TopoPlots\nusing PyMNE","category":"page"},{"location":"literate/reference/positions/#get-MNE-positions","page":"Convert 3D positions / montages to 2D layouts","title":"get MNE-positions","text":"","category":"section"},{"location":"literate/reference/positions/","page":"Convert 3D positions / montages to 2D layouts","title":"Convert 3D positions / montages to 2D layouts","text":"Generate a fake MNE structure taken from mne documentation","category":"page"},{"location":"literate/reference/positions/","page":"Convert 3D positions / montages to 2D layouts","title":"Convert 3D positions / montages to 2D layouts","text":"biosemi_montage = PyMNE.channels.make_standard_montage(\"biosemi64\")\nn_channels = length(biosemi_montage.ch_names)\nfake_info = PyMNE.create_info(ch_names=biosemi_montage.ch_names, sfreq=250.,\n ch_types=\"eeg\")\ndata = rand(n_channels,1) * 1e-6\nfake_evoked = PyMNE.EvokedArray(data, fake_info)\nfake_evoked.set_montage(biosemi_montage)\n\npos = UnfoldMakie.toPositions(fake_evoked)","category":"page"},{"location":"literate/reference/positions/#project-from-3D-electrode-locations-to-2D","page":"Convert 3D positions / montages to 2D layouts","title":"project from 3D electrode locations to 2D","text":"","category":"section"},{"location":"literate/reference/positions/","page":"Convert 3D positions / montages to 2D layouts","title":"Convert 3D positions / montages to 2D layouts","text":"pos3d = hcat(values(pyconvert(Dict,biosemi_montage.get_positions()[\"ch_pos\"]))...)\n\npos2 = to_positions(pos3d)\n\nf = Figure(resolution=(600,300))\nscatter(f[1,1],pos3d[1:2,:])\nscatter(f[1,2],pos2)\nf","category":"page"},{"location":"literate/reference/positions/","page":"Convert 3D positions / montages to 2D layouts","title":"Convert 3D positions / montages to 2D layouts","text":"as one can see, the \"naive\" transform of just dropping the third dimension doesnt really work (left). We rather have to project the chanels to a sphere and unfold it (right)","category":"page"},{"location":"literate/reference/positions/","page":"Convert 3D positions / montages to 2D layouts","title":"Convert 3D positions / montages to 2D layouts","text":"","category":"page"},{"location":"literate/reference/positions/","page":"Convert 3D positions / montages to 2D layouts","title":"Convert 3D positions / montages to 2D layouts","text":"This page was generated using Literate.jl.","category":"page"},{"location":"tutorials/designmatrix/#dm_vis","page":"Designmatrix","title":"Designmatrix Visualization","text":"","category":"section"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"Here we discuss designmatrix visualization. Make sure you have looked into the installation instructions section. ","category":"page"},{"location":"tutorials/designmatrix/#Include-used-Modules","page":"Designmatrix","title":"Include used Modules","text":"","category":"section"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"The following modules are necessary for following this tutorial:","category":"page"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"using Unfold\nusing UnfoldMakie\nusing DataFrames\nusing CairoMakie","category":"page"},{"location":"tutorials/designmatrix/#Data","page":"Designmatrix","title":"Data","text":"","category":"section"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"In case you do not already have data, look at the Load Data section. ","category":"page"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"include(\"../../example_data.jl\")\nuf = example_data(\"UnfoldLinearModel\")\n","category":"page"},{"location":"tutorials/designmatrix/#Plot-Designmatrices","page":"Designmatrix","title":"Plot Designmatrices","text":"","category":"section"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"The following code will result in the default configuration. ","category":"page"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"plot_designmatrix(designmatrix(uf))","category":"page"},{"location":"tutorials/designmatrix/#plot_designmatrix(...;extra(namevalue,...).","page":"Designmatrix","title":"plot_designmatrix(...;extra=(=,...).","text":"","category":"section"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"sortData (boolean,false) - Indicating whether the data is sorted; using sortslices() of Base Julia. ","category":"page"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"In order to make the designmatrix easier to read, you may want to sort it.","category":"page"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"plot_designmatrix(designmatrix(uf);extra=(;sortData=true))","category":"page"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"standardizeData (boolean,false) - Indicating whether the data is standardized, mapping the values between 0 and 1. ","category":"page"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"xTicks (number,nothing)","category":"page"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"Indicating the number of labels on the x-axis. Behavior if specified in configuration: - xTicks = 0: no labels are placed. - xTicks = 1: first possible label is placed. - xTicks = 2: first and last possible labels are placed. - 2 < xTicks < number of labels: xTicks-2 labels are placed between the first and last. - xTicks ≥ number of labels: all labels are placed.","category":"page"},{"location":"how_to/hide_deco/#ht_hide_deco","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"","category":"section"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"In this section we discuss how users are able to efficiently hide axis spines and decorations in their plots.","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"While it's possible to hide these axis decorations through setting the axis settings with axis=(;...), Makie.Axis features multiple variables for different aspects of the plot. This means that removing all decoration is only possible by setting a lot of variables each time.","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"Makie does feature methods like hidespines! and hidedecorations!, but the user might not have easy acces to the axis their plot is drawn in.","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"So instead these functions can be called by setting variables with layout = (;):","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"... layout = (\n ...\n hidespines = (),\n hidedecorations = ()\n)","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"Since these values mirror the input of the function, we can use an empty tuple to remove all decorations or spines respectively","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"And using hidespines = (:r, :t) results in the removal of the top and right border.","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"For more information on the input of these functions refer to the Makie dokumentation on Axis.","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"Since some plots hide features by default, the hiding can be reverted by setting the variables to nothing","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"plot_xxx(...;layout=(;\n hidespines = nothing,\n hidedecorations = nothing\n)","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"(Image: Topoplot with all axis spines and decorations enabled)","category":"page"},{"location":"#UnfoldMakie-Documentation","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"","category":"section"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"This is the documentation of the UnfoldMakie module for the Julia programming language. ","category":"page"},{"location":"#About","page":"UnfoldMakie Documentation","title":"About","text":"","category":"section"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"UnfoldMakie aims to allow users to generate different types of visualizations. These include line plots, butterfly plots, designmatrices, parallel coordinates plots, ERP images and topo plots. Building on the Unfold and Makie Modules, it also grants users customizability through an input configuration on the plots.","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"As is apparent considering the types of possible visualizations, these config options try to enable users to create plots, that are helpful in the subject area of computational EEG. One such example is the possibility of using a topo plot as a legend for a line plot by allowing for multiple visualizations within one figure.","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"(Image: Coordinated Multiple Views)","category":"page"},{"location":"#Structure","page":"UnfoldMakie Documentation","title":"Structure","text":"","category":"section"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"For easy readability, the documentation is divided into sections users can inspect depending on their query.","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"The Tutorials: Setup section contains all information to get started including installation and how to aquire necessary data for testing if the user has none.","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"The Tutorials: Visualizations section summarizes all possible visualizations and how users can generate them. It also details their unique configuration options.","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"These visualizations are:","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"Designmatrices\nLine Plots\nButterfly Plots\nERP Images\nTopo Plots\nParallel Coordinate Plots","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"The Plot Configuration all segments of the config, detailing their contained attributes. The plot config is the prime interface allowing the user to access the different visualition options. As the options can be quite different in nature, the plot config is further split into categories. These segments are:","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"Axis Data\nColorbar Data\nExtra Data\nLayout Data\nLegend Data\nMapping Data\nVisual Data","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"The How To section features information on how to achieve specific goals or deal with specific problems.","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"These segments are:","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"Fix Parallel Coordinates Plot\nGenerate a Timeexpanded Designmatrix\nHide Axis Spines and Decorations\nInclude multiple Visualizations in one Figure\nShow out of Bounds Label","category":"page"},{"location":"#Used-Packages","page":"UnfoldMakie Documentation","title":"Used Packages","text":"","category":"section"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"Everything was tested with Julia v1.7.","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"The following module in their respective versions are used internally by UnfoldMakie:","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"AlgebraOfGraphics v0.6.9\nCairoMakie v0.8.9\nColors v0.12.8\nColorSchemes v3.19.0\nDataFrames v1.3.4\nGeometryBasics v0.4.2\nImageFiltering v0.7.1\nMakie v0.17.9\nPipe v1.3.0\nPyMNE v0.1.2\nTopoPlots v0.1.0\nUnfold v0.3.11\nLinearAlgebra \nSparseArrays\nStatistics","category":"page"},{"location":"tutorials/installation/#install_instruct","page":"Installation","title":"Installation","text":"","category":"section"},{"location":"tutorials/installation/#Getting-Julia","page":"Installation","title":"Getting Julia","text":"","category":"section"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"You can install Julia by following the instructions from the official website. ","category":"page"},{"location":"tutorials/installation/#Setup-UnfoldMakie.jl","page":"Installation","title":"Setup UnfoldMakie.jl","text":"","category":"section"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"After installing Julia, you can execute the julia.exe. ","category":"page"},{"location":"tutorials/installation/#Generate-a-Project","page":"Installation","title":"Generate a Project","text":"","category":"section"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"If you do not yet have a project you can generate one. First you type ] into the Julia console to switch from julia to (@VERSION) pkg. Here you can generate a project by using the command: ","category":"page"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"generate \"FOLDER_PATH\"","category":"page"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"Note that the specific folder in which you want to generate the project does not already exist.","category":"page"},{"location":"tutorials/installation/#Activate-your-Project","page":"Installation","title":"Activate your Project","text":"","category":"section"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"Before you can add the necessary modules to use UnfoldMakie you have to activate your project in the (@VERSION) pkg environment. The command is: ","category":"page"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"activate \"FOLDER_PATH\"","category":"page"},{"location":"tutorials/installation/#Install-the-UnfoldMakie-Module","page":"Installation","title":"Install the UnfoldMakie Module","text":"","category":"section"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"When your project is activated you can add the module. The command is: ","category":"page"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"add UnfoldMakie","category":"page"},{"location":"tutorials/installation/#Using-the-Project-in-a-Notebook","page":"Installation","title":"Using the Project in a Notebook","text":"","category":"section"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"In case you want to use this generated project in a notebook (e.g. Pluto or Jupyter), you can activate this in the notebook in the following manner:","category":"page"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"begin\n using Pkg\n Pkg.activate(\"FOLDER_PATH\")\n Pkg.resolve()\nend","category":"page"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"Use slash / for the folder path. ","category":"page"}] +[{"location":"how_to/show_oob_labels/#ht_soobl","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"","category":"section"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"When visualizing a designmatrix it can happen that the labels on the y-axis get cut off towards the left (especially if they are quite long). In the following we discuss a possible quick fix for this problem.","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"Here we start off with the \"label-limited\" timeexpanded designmatrix from the corresponding How To section that details how it can be generated.","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"plot_designmatrix(designmatrix!(ufCont,evts),cDesign;setExtraValues=(xTicks=10, sortData=false))","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"#(Image: Label Limited Timeexpanded Designmatrix)","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"While the plot automatically sets it's height accoring to the labels, they are cut off on the left side.","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"A quick fix would be to place an empty plot to the left of the designmatrix.","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"By creating your own figure with Makie.Figure, and then only giving a certain grid position to the designmatrix we get white space next to the plot.","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"The plot! function inside the plot config instance can take any grid position, and the figure f will include plot and sufficient white space next to it.","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"The exact numbers in the grid position can be guessed from the ratio of the overlap, or just tried out.","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"f = Figure()\nplot_design(f[1,2:6],designmatrix!(ufCont,evts),cDesign;setExtraValues=(xTicks=10, sortData=false))\n\nf","category":"page"},{"location":"how_to/show_oob_labels/","page":"Show out of Bounds Label","title":"Show out of Bounds Label","text":"#(Image: Label Limited Timeexpanded Designmatrix)","category":"page"},{"location":"config/legend_data/#config_legend","page":"Legend Data","title":"Legend Data","text":"","category":"section"},{"location":"config/legend_data/","page":"Legend Data","title":"Legend Data","text":"The legend data of the configuration consists of config options for the legend. ","category":"page"},{"location":"config/legend_data/#Line-Plots-and-Butterfly-Plots","page":"Legend Data","title":"Line Plots and Butterfly Plots","text":"","category":"section"},{"location":"config/legend_data/","page":"Legend Data","title":"Legend Data","text":"For line plots the legend! function of the AlgebraOfGraphics module is used (documentation).","category":"page"},{"location":"config/legend_data/","page":"Legend Data","title":"Legend Data","text":"The Legend will be used automatically, when AlgebraOfGraphics is able to draw it. For this the color data will be used and has to be either non-numerical or funcall(...;extra=(categoricalColor=true,) needs to be set true.","category":"page"},{"location":"config/legend_data/#Parallel-Coordinates-Plots","page":"Legend Data","title":"Parallel Coordinates Plots","text":"","category":"section"},{"location":"config/legend_data/","page":"Legend Data","title":"Legend Data","text":"In a parallel coordinate plot the Legend function of the Makie module is used (documentation).","category":"page"},{"location":"config/legend_data/","page":"Legend Data","title":"Legend Data","text":"The Legend will only be used when funcall(...;layout=(showLegend=true,) is true and funcall(...;layout=(useColorbar=false,) is false","category":"page"},{"location":"config/legend_data/#Legend-data-default-options","page":"Legend Data","title":"Legend data default options","text":"","category":"section"},{"location":"config/legend_data/","page":"Legend Data","title":"Legend Data","text":"orientation = :vertical\ntellwidth = true\ntellheight = true","category":"page"},{"location":"config/extra_data/#config_extra","page":"Extra Data","title":"Extra Data","text":"","category":"section"},{"location":"config/extra_data/","page":"Extra Data","title":"Extra Data","text":"The extra data of the configuration consists of all config options that are unique for the visualizations.","category":"page"},{"location":"config/extra_data/","page":"Extra Data","title":"Extra Data","text":"The available options for each plot are described at the end of their respective tutorial in the Tutorials: Visualizations section.","category":"page"},{"location":"config/axis_data/#config_axis","page":"Axis Data","title":"Axis Data","text":"","category":"section"},{"location":"config/axis_data/","page":"Axis Data","title":"Axis Data","text":"The axis data of the configuration consists of config options for the axis. ","category":"page"},{"location":"config/axis_data/","page":"Axis Data","title":"Axis Data","text":"The input of this config is directly fed into the Axis function of the Makie module. As a consequence, the possible options are also determined by the function. Details for these options can be found in the corresponding article of the Makie documentation.","category":"page"},{"location":"how_to/position2color/#ht_p2c","page":"Butterfly Colormap","title":"Change Butterfly Channel Position Color","text":"","category":"section"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"In this section we discuss how users are able change the position to colorscale of the legendtopo in the butterfly plot.","category":"page"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"using UnfoldMakie\nusing CairoMakie\nusing DataFramesMeta","category":"page"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"By default the plot looks like this:","category":"page"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"include(\"../../example_data.jl\")\nresults,positions = example_data(\"TopoPlots.jl\")\nplot_butterfly(results;positions=positions)","category":"page"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"We can switch the colorscale of the position-map, by giving a function that maps from a (x,y) tuple to a color. UnfoldMakie currently provides three different ones pos2colorRGB (same as MNE-Python), pos2colorHSV (HSV colorspace), pos2colorRomaO. Whereas RGB & HSV have the benefits of being 2D colormaps, Roma0 has the benefit of being perceptualy uniform.","category":"page"},{"location":"how_to/position2color/#Similar-to-MNE","page":"Butterfly Colormap","title":"Similar to MNE","text":"","category":"section"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"plot_butterfly(results;positions=positions,extra=(;topoPositionToColorFunction=pos->UnfoldMakie.posToColorRGB(pos)))","category":"page"},{"location":"how_to/position2color/#HSV-Space","page":"Butterfly Colormap","title":"HSV-Space","text":"","category":"section"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"plot_butterfly(results;positions=positions,extra=(;topoPositionToColorFunction=UnfoldMakie.posToColorHSV))","category":"page"},{"location":"how_to/position2color/#Uniform-Color","page":"Butterfly Colormap","title":"Uniform Color","text":"","category":"section"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"To highlight the flexibility, we can also make all lines gray, or any other arbitrary color, or function of electrode-position.","category":"page"},{"location":"how_to/position2color/","page":"Butterfly Colormap","title":"Butterfly Colormap","text":"using Colors\nplot_butterfly(results;positions=positions,extra=(;topoPositionToColorFunction=x->Colors.RGB(0.5)))","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"EditURL = \"erp.jl\"","category":"page"},{"location":"literate/tutorials/erp/#lp_vis","page":"ERP plot","title":"Line Plot Visualization","text":"","category":"section"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"Here we discuss line plot visualization. Make sure you have looked into the installation instructions.","category":"page"},{"location":"literate/tutorials/erp/#Include-used-Modules","page":"ERP plot","title":"Include used Modules","text":"","category":"section"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"The following modules are necessary for following this tutorial:","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"using Unfold\nusing UnfoldMakie\nusing DataFrames\nusing CairoMakie\nusing DataFramesMeta\nusing UnfoldSim\nusing UnfoldMakie","category":"page"},{"location":"literate/tutorials/erp/#Setup","page":"ERP plot","title":"Setup","text":"","category":"section"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"Let's generate some data and fit a model of a 2-level categorical and a continuous predictor with interaction.","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"data,evts = UnfoldSim.predef_eeg(;noiselevel=12,return_epoched=true)\ndata = reshape(data,(1,size(data)...))\nf = @formula 0 ~ 1+condition+continuous\nse_solver =(x,y)->Unfold.solver_default(x,y,stderror=true);\n\nm = fit(UnfoldModel, Dict(Any=>(f,range(0,step=1/100,length=size(data,2)))), evts, data,solver=se_solver)\nresults = coeftable(m)\nres_effects = effects(Dict(:continuous=>-5:0.5:5),m);\nnothing #hide","category":"page"},{"location":"literate/tutorials/erp/#Plot-the-results","page":"ERP plot","title":"Plot the results","text":"","category":"section"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"plot_erp(results; extra=(:stderror=>true,))","category":"page"},{"location":"literate/tutorials/erp/#Column-Mappings-for-Line-Plots","page":"ERP plot","title":"Column Mappings for Line Plots","text":"","category":"section"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"plot_erp use a DataFrame as an input, the library needs to know the names of the columns used for plotting.","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"There are multiple default values, that are checked in that order if they exist in the DataFrame, a custom name can be chosen using plot_erp(...;mapping=(; :y=:myEstimate)","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":":x Default is (:x, :time). :y Default is (:y, :estimate, :yhat). :color Default is (:color, :coefname).","category":"page"},{"location":"literate/tutorials/erp/#Configuration-for-Line-Plots","page":"ERP plot","title":"Configuration for Line Plots","text":"","category":"section"},{"location":"literate/tutorials/erp/#extra","page":"ERP plot","title":"extra","text":"","category":"section"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"plot_erp(...;extra=(;=,...).","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"categoricalColor (boolean, true) - in case of numeric :color column, is color a continuous or categorical variable?\ncategoricalGroup (boolean, true) - in case of numeric :group column, treat :group as categorical variable by default\nstderror (boolean, false) - add an error-ribbon based on the :stderror column\npvalue (see below)","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"Using some general configurations we can pretty up the default visualization. Here we use the following configuration:","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"plot_erp(res_effects;\n mapping = (;y=:yhat,color=:continuous, group=:continuous),\n extra=(;showLegend=true,\n categoricalColor=false,\n categoricalGroup=true),\n legend = (;nbanks=2),\n layout = (;legendPosition=:right))","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"In the following we will use this \"pretty\" line plot as a basis for looking into configuration options.","category":"page"},{"location":"literate/tutorials/erp/#pvalue-(array)","page":"ERP plot","title":"pvalue (array)","text":"","category":"section"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"important: Important\nthis is currently broken!","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"Is an array of p-values. If array not empty, plot shows colored lines under the plot representing the p-values. Default is [] (an empty array). Shown below is an example in which pvalue are given: pvals = DataFrame(","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"#\t\tfrom=[0.1,0.3],\n#\t\tto=[0.5,0.7],\n#\t\tcoefname=[\"(Intercept)\",\"condition: face\"] # if coefname not specified, line should be black\n#\t)","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"plot_erp(results;extra= (;:pvalue=>pvals))","category":"page"},{"location":"literate/tutorials/erp/#stderror-(boolean)","page":"ERP plot","title":"stderror (boolean)","text":"","category":"section"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"Indicating whether the plot should show a colored band showing lower and higher estimates based on the stderror. Default is false.","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"previously we showed :stderror- but low/high is possible as well`","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"results.se_low = results.estimate .- 0.5\nresults.se_high = results.estimate .+ 0.15\nplot_erp(select(results,Not(:stderror));extra= (;stderror=true))","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"note: Note\nas in the above code,:stderror has precedence over :se_low/:se_high","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"","category":"page"},{"location":"literate/tutorials/erp/","page":"ERP plot","title":"ERP plot","text":"This page was generated using Literate.jl.","category":"page"},{"location":"config/visual_data/#config_visual","page":"Visual Data","title":"Visual Data","text":"","category":"section"},{"location":"config/visual_data/","page":"Visual Data","title":"Visual Data","text":"The visual data of the configuration will be passed to the underlying plotting functions and can be used to set their specific attributes.","category":"page"},{"location":"config/visual_data/","page":"Visual Data","title":"Visual Data","text":"As a consequence, the possible options are determined by the following functions:","category":"page"},{"location":"config/visual_data/","page":"Visual Data","title":"Visual Data","text":"Designmatrix, ERP Image : heatmap (documentation)\nLine Plot, Butterfly Plot, PCP : lines (documentation)\nTopo Plot, EEG Topo Plot : topoplot,eeg_topoplot (documentation)","category":"page"},{"location":"config/colorbar_data/#config_colorbar","page":"Colorbar Data","title":"Colorbar Data","text":"","category":"section"},{"location":"config/colorbar_data/","page":"Colorbar Data","title":"Colorbar Data","text":"The colorbar data of the configuration consists of config options for the colorbar that can be used as a legend. As a consequence, the possible options are determined by the underlying functions.","category":"page"},{"location":"config/colorbar_data/#ERP-Plots","page":"Colorbar Data","title":"ERP Plots","text":"","category":"section"},{"location":"config/colorbar_data/","page":"Colorbar Data","title":"Colorbar Data","text":"For ERP plots, the colorbar! function of the AlgebraOfGraphics module is used (documentation).","category":"page"},{"location":"config/colorbar_data/","page":"Colorbar Data","title":"Colorbar Data","text":"The Colorbar will be automatically used, when AlgebraOfGraphics is able to draw it. For this, the color data will be used and has to be numerical. Furthermore extra=(;categoricalColor=false) needs to be false.","category":"page"},{"location":"config/colorbar_data/#Other-Plots","page":"Colorbar Data","title":"Other Plots","text":"","category":"section"},{"location":"config/colorbar_data/","page":"Colorbar Data","title":"Colorbar Data","text":"In all other Plots the Colorbar function of the Makie module is used (documentation).","category":"page"},{"location":"config/colorbar_data/","page":"Colorbar Data","title":"Colorbar Data","text":"The Colorbar will only be used when both layoutData.showLegend and layoutData.useColorbar are set true.","category":"page"},{"location":"config/colorbar_data/#Colorbar-data-default-values","page":"Colorbar Data","title":"Colorbar data default values","text":"","category":"section"},{"location":"config/colorbar_data/","page":"Colorbar Data","title":"Colorbar Data","text":"vertical = true\ntellwidth = true\ntellheight = true","category":"page"},{"location":"how_to/fix_pcp/#ht_fpcp","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"","category":"section"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"Since Makie didn't have a native function to draw PCPs our version is somewhat experimental for broad applications.","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"Under certain circumstances the PCP is not properly visualized. This leads to cut off edges of the PCP, and unused space.","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"Especially when changing the container size by customizing the figure resolution, or adding multiple plots into one figure, the PCP can have problems fitting inside.","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"(Image: PCP with cutoff and bad spacing)","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"We can set some variables to fix these issues using","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"paraConfig.setExtraValues(\n ...\n)","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"Since the plot could have more space above and below, we can change the aspect ratio of the plot with:","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"...\npc_aspect_ratio = 1,\n...","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"The cut off or overlap at each side can be fixed with:","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"...\npc_right_padding = 15,\npc_left_padding = 45,\npc_top_padding = 50,\npc_bottom_padding = 27,\n...","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"Furthermore, if the tick-number size becomes too big or small it can be changed with:","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"...\npc_tick_label_size = 25,\n...","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"By setting these manually through trial and error we can fix the visualization issues:","category":"page"},{"location":"how_to/fix_pcp/","page":"Fix Parallel Coordinates Plot","title":"Fix Parallel Coordinates Plot","text":"(Image: Fixed PCP)","category":"page"},{"location":"config/mapping_data/#config_mapping","page":"Mapping Data","title":"Mapping Data","text":"","category":"section"},{"location":"config/mapping_data/","page":"Mapping Data","title":"Mapping Data","text":"The mapping data of the configuration is used to let the plotting functions know which columns of a DataFrame contain which data. Therefore it is only used in plots with a DataFrame as input.","category":"page"},{"location":"config/mapping_data/","page":"Mapping Data","title":"Mapping Data","text":"For example a Line Plot makes use of the x and y mappings. To have our Line Plot use the \"estimate\" column for x and the \"time\" column for y we can use:","category":"page"},{"location":"config/mapping_data/","page":"Mapping Data","title":"Mapping Data","text":"plot_erp(...;mapping=(;x=:estimate,))\n","category":"page"},{"location":"config/mapping_data/","page":"Mapping Data","title":"Mapping Data","text":"Which columns are used by which plotting function can be looked up in their respective tutorials in the Tutorials: Visualizations section.","category":"page"},{"location":"config/mapping_data/#Multiple-Options","page":"Mapping Data","title":"Multiple Options","text":"","category":"section"},{"location":"config/mapping_data/","page":"Mapping Data","title":"Mapping Data","text":"In addition to providing a single column which contains the specified data, the user can also provide a list of columns which may contain the data.","category":"page"},{"location":"config/mapping_data/","page":"Mapping Data","title":"Mapping Data","text":"plot_erp(...;mapping=(;y = (:y, :yhat, :estimate)))","category":"page"},{"location":"config/mapping_data/","page":"Mapping Data","title":"Mapping Data","text":"In this case the first available column will be chosen.","category":"page"},{"location":"config/mapping_data/","page":"Mapping Data","title":"Mapping Data","text":"Some configurations for certain plots already have a default column or a list of columns set. This way the user might not need to set any mapping values themselves, in case the DataFrame conforms to the same standards.","category":"page"},{"location":"how_to/mult_vis_in_fig/#ht_mvf","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"","category":"section"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"using UnfoldMakie\nusing CairoMakie\nusing DataFramesMeta\nusing UnfoldSim\nusing Unfold\nusing MakieThemes\nset_theme!(theme_ggthemr(:fresh)) # nicer defaults - should maybe be default?\n","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"include(\"../../example_data.jl\")\nd_topo, positions = example_data(\"TopoPlots.jl\")\nuf_deconv = example_data(\"UnfoldLinearModelContinuousTime\")\nuf = example_data(\"UnfoldLinearModel\")\nresults = coeftable(uf)\nuf_5chan = example_data(\"UnfoldLinearModelMultiChannel\")\nd_singletrial, _ = UnfoldSim.predef_eeg(; return_epoched=true)\nnothing #hide","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"In this section we discuss how users are able to include multiple visualizations in a single figure.","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"By using the !-version of the plotting function and putting in a grid position instead of a full figure, we can create Multiple Coordinated Views.","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"You start by creating a figure with Makie.Figure. ","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"f = Figure()","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"Now each plot can be added to f by putting in a grid position, such as f[1,1].","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"\nf = Figure()\nplot_erp!(f[1, 1], coeftable(uf_deconv))\nplot_erp!(f[1, 2], effects(Dict(:condition => [\"car\", \"face\"]), uf_deconv), mapping=(; color=:condition))\nplot_butterfly!(f[2, 1:2], d_topo; positions=positions)\n\nf","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"By using the data from the tutorials we can create a big image with every type of plot.","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"With so many plots at once it's incentivised to set a fixed resolution in your figure to order the plots evenly (Code below).","category":"page"},{"location":"how_to/mult_vis_in_fig/","page":"Include multiple Visualizations in one Figure","title":"Include multiple Visualizations in one Figure","text":"\nf = Figure(resolution=(2000, 2000))\n\nplot_butterfly!(f[1, 1:3], d_topo; positions=positions)\n\npvals = DataFrame(\n from=[0.1, 0.15],\n to=[0.2, 0.5],\n # if coefname not specified, line should be black\n coefname=[\"(Intercept)\", \"category: face\"]\n)\nplot_erp!(f[2, 1:2], results, extra=(;\n categoricalColor=false,\n categoricalGroup=false,\n pvalue=pvals,\n stderror=true))\n\n\nplot_designmatrix!(f[2, 3], designmatrix(uf))\n\n#plot_designmatrix!(f[2,4], designmatrix(uf_deconv);visual=(;colormap=:inferno))\n\nplot_topoplot!(f[3, 1], collect(1:64); positions=positions, visual=(; colormap=:viridis))\nplot_topoplotseries!(f[4, 1:3], d_topo, 0.1; positions=positions, mapping=(; label=:channel))\n\n\nres_effects = effects(Dict(:continuous => -5:0.5:5), uf_deconv)\n\nplot_erp!(f[2, 4:5], res_effects;\n mapping=(; y=:yhat, color=:continuous, group=:continuous),\n extra=(; showLegend=true,\n categoricalColor=false,\n categoricalGroup=true),\n legend=(; nbanks=2),\n layout=(; legendPosition=:right))\n\n\n\nplot_parallelcoordinates!(f[3, 2:3], uf_5chan, [1, 2, 3, 4, 5]; mapping=(; color=:coefname), layout=(; legendPosition=:bottom))\n\nplot_erpimage!(f[1, 4:5], d_singletrial)\nplot_circulareegtopoplot!(f[3:4, 4:5], d_topo[in.(d_topo.time, Ref(-0.3:0.1:0.5)), :]; \n positions=positions, predictor=:time, extra=(; predictorBounds=[-0.3, 0.5]))\n\nf","category":"page"},{"location":"tutorials/topoplotseries/#tpseries_vis","page":"Topo Plot Series","title":"Topo Plot SeriesVisualization","text":"","category":"section"},{"location":"tutorials/topoplotseries/#Include-used-Modules","page":"Topo Plot Series","title":"Include used Modules","text":"","category":"section"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"The following modules are necessary for following this tutorial:","category":"page"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"using Unfold\nusing UnfoldMakie\nusing DataFrames\nusing CairoMakie\nusing TopoPlots","category":"page"},{"location":"tutorials/topoplotseries/#Plot-Topo-Plots-Series","page":"Topo Plot Series","title":"Plot Topo Plots Series","text":"","category":"section"},{"location":"tutorials/topoplotseries/#Giving-the-Data","page":"Topo Plot Series","title":"Giving the Data","text":"","category":"section"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"In case you do not already have data, you can get example data from the TopoPlots module. You can do it like this:","category":"page"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"data, positions = TopoPlots.example_data()\ndf = UnfoldMakie.eeg_matrix_to_dataframe(data[:,:,1], string.(1:length(positions)));\nnothing #hide","category":"page"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"Δbin = 80\nplot_topoplotseries(df, Δbin; positions = positions)","category":"page"},{"location":"tutorials/topoplotseries/#Positions","page":"Topo Plot Series","title":"Positions","text":"","category":"section"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"You can give either positions, or labels. If both are provided, positions have priority","category":"page"},{"location":"tutorials/topoplotseries/#plot_toposeries(...;mapping(;keyvalue))","page":"Topo Plot Series","title":"plot_toposeries(...;mapping=(;key=value))","text":"","category":"section"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"mapping=(:y=(:estimate,:yhat,:y))","category":"page"},{"location":"tutorials/topoplotseries/#visual(;)","page":"Topo Plot Series","title":"visual=(;)","text":"","category":"section"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"label_text (boolean, false) Indicates whether label should drawn next to their position. The labels have to be given into the function seperately:","category":"page"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"important: Important\ncurrently bugged","category":"page"},{"location":"tutorials/topoplotseries/","page":"Topo Plot Series","title":"Topo Plot Series","text":"label_scatter (boolean, true) - Indicates whether the dots should be drawn at the given positions.","category":"page"},{"location":"config/layout_data/#config_layout","page":"Layout Data","title":"Layout Data","text":"","category":"section"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"The layout data of the configuration consists of config options for the layout such as the legend and labels.","category":"page"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"The following layout data options exist (the default values may be different for some plots types):","category":"page"},{"location":"config/layout_data/#showLegend-(boolean)","page":"Layout Data","title":"showLegend (boolean)","text":"","category":"section"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"Indicating whether the legend is displayed. Default is true.","category":"page"},{"location":"config/layout_data/#legendPostion-(Symbol)","page":"Layout Data","title":"legendPostion (Symbol)","text":"","category":"section"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"Indicating the position and orientation of the legend. Possible values are :right and :bottom. Default is :right.","category":"page"},{"location":"config/layout_data/#useColorbar-(boolean)","page":"Layout Data","title":"useColorbar (boolean)","text":"","category":"section"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"Indicating whether the colorbar should be used. Default is false.","category":"page"},{"location":"config/layout_data/#xlabelFromMapping-(Symbol/Nothing)","page":"Layout Data","title":"xlabelFromMapping (Symbol/Nothing)","text":"","category":"section"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"Which data column should be used for the xlabel. Set to nothing if no column name should be used. Default is :x.","category":"page"},{"location":"config/layout_data/#ylabelFromMapping-(Symbol/Nothing)","page":"Layout Data","title":"ylabelFromMapping (Symbol/Nothing)","text":"","category":"section"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"Which data column should be used for the ylabel. Set to nothing if no column name should be used. Default is :y.","category":"page"},{"location":"config/layout_data/#other-Makie-functions","page":"Layout Data","title":"other Makie functions","text":"","category":"section"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"In addition to the previous options the hidespines! and hidedecorations! functions from the Makie module can be enabled by setting their respective parameters as follows.","category":"page"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"config.setLayoutValues(\n ...\n hidespines = (:r, :t),\n hidedecorations = ()\n)","category":"page"},{"location":"config/layout_data/","page":"Layout Data","title":"Layout Data","text":"Setting them to nothing will disable them. More information on how to use them can be found in this HowTo","category":"page"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"EditURL = \"circTopo.jl\"","category":"page"},{"location":"literate/tutorials/circTopo/#Circular-Topoplot-Arrangement","page":"Circular TopoPlot","title":"Circular Topoplot Arrangement","text":"","category":"section"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"using UnfoldMakie\nusing CairoMakie\nusing TopoPlots # for example data\nusing Random\nusing DataFrames","category":"page"},{"location":"literate/tutorials/circTopo/#Generate-data","page":"Circular TopoPlot","title":"Generate data","text":"","category":"section"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"Generate a Dataframe. We need to specify the TopoPlot Positions either via position, or via labels (according to TopoPlots.jl)","category":"page"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"data,pos = TopoPlots.example_data();\ndat = data[:, 240, 1]\ndf= DataFrame(\n :estimate=>eachcol(Float64.(data[:,100:40:300,1])),\n :circularVariable=>[0,50,80,120,180,210],\n :time=>100:40:300)\ndf = flatten(df,:estimate);\nnothing #hide","category":"page"},{"location":"literate/tutorials/circTopo/#Our-first-plot!","page":"Circular TopoPlot","title":"Our first plot!","text":"","category":"section"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"note how the plots are at the angles of circularVariable`","category":"page"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"plot_circulareegtopoplot(df;positions=pos,axis=(;label=\"Sac Incoming\"),predictor=:circularVariable)","category":"page"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"In case the bounding variable is not between 0 and 360, as here we use actually time, we have to specify it. e.g.","category":"page"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"plot_circulareegtopoplot(df;positions=pos,axis=(;label=\"Time?!\"),predictor=:time,extra=(;predictorBounds=[80,320]))","category":"page"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"","category":"page"},{"location":"literate/tutorials/circTopo/","page":"Circular TopoPlot","title":"Circular TopoPlot","text":"This page was generated using Literate.jl.","category":"page"},{"location":"tutorials/parallelcoordinates/#pcp_vis","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"Here we discuss parallel coordinates plot (PCP) visualization. ","category":"page"},{"location":"tutorials/parallelcoordinates/#Include-used-Modules","page":"Parallel Coordinates Plot","title":"Include used Modules","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"The following modules are necessary for following this tutorial:","category":"page"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"using Unfold\nusing UnfoldMakie\nusing DataFrames\nusing CairoMakie","category":"page"},{"location":"tutorials/parallelcoordinates/#Data","page":"Parallel Coordinates Plot","title":"Data","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"In case you do not already have data, look at the Load Data section. ","category":"page"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"We use the test data of erpcore-N170.jld2.","category":"page"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"include(\"../../example_data.jl\")\nresults_plot, positions = example_data();","category":"page"},{"location":"tutorials/parallelcoordinates/#Plot-PCPs","page":"Parallel Coordinates Plot","title":"Plot PCPs","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"plot_parallelcoordinates(results_plot,[5,3,2]; # this selects channel 5,3 & 2 \n mapping = (color = :coefname, y = :estimate))","category":"page"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"important: Important\nthe following is still outdated...","category":"page"},{"location":"tutorials/parallelcoordinates/#Column-Mappings-for-PCPs","page":"Parallel Coordinates Plot","title":"Column Mappings for PCPs","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"Since PCPs use a DataFrame as an input, the library needs to know the names of the columns used for plotting.","category":"page"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"For more informations about mapping values, look into the Mapping Data section of the documentation.","category":"page"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"While there are multiple default values that are checked in that order if they exist in the DataFrame, a custom name might need to be choosen for:","category":"page"},{"location":"tutorials/parallelcoordinates/#y","page":"Parallel Coordinates Plot","title":"y","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"Default is (:y, :estimate, :yhat).","category":"page"},{"location":"tutorials/parallelcoordinates/#channel","page":"Parallel Coordinates Plot","title":"channel","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"Default is :channel.","category":"page"},{"location":"tutorials/parallelcoordinates/#color","page":"Parallel Coordinates Plot","title":"color","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"XXX Default is :coef.","category":"page"},{"location":"tutorials/parallelcoordinates/#time","page":"Parallel Coordinates Plot","title":"time","text":"","category":"section"},{"location":"tutorials/parallelcoordinates/","page":"Parallel Coordinates Plot","title":"Parallel Coordinates Plot","text":"Default is :time.","category":"page"},{"location":"tutorials/erpimage/#erpi_vis","page":"ERP Image","title":"ERP Image Visualization","text":"","category":"section"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"Here we discuss ERP image visualization. Make sure you have looked into the installation instructions.","category":"page"},{"location":"tutorials/erpimage/#Include-used-Modules","page":"ERP Image","title":"Include used Modules","text":"","category":"section"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"The following modules are necessary for following this tutorial:","category":"page"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"using Unfold\nusing UnfoldMakie\nusing CairoMakie\nusing UnfoldSim\ninclude(\"../../example_data.jl\")","category":"page"},{"location":"tutorials/erpimage/#Plot-ERP-Images","page":"ERP Image","title":"Plot ERP Images","text":"","category":"section"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"The following code will result in the default configuration. ","category":"page"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"data, evts = UnfoldSim.predef_eeg(; noiselevel=10, return_epoched=true)\nplot_erpimage(data)","category":"page"},{"location":"tutorials/erpimage/#Column-Mappings-for-ERP-Images","page":"ERP Image","title":"Column Mappings for ERP Images","text":"","category":"section"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"Since ERP images use a Matrix as an input, the library does not need any informations about the mapping.","category":"page"},{"location":"tutorials/erpimage/#extra(;)","page":"ERP Image","title":"extra=(;)","text":"","category":"section"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"erpBlur (number,10 ) - Is a number indicating how much blur is applied to the image; using Gaussian blur of the ImageFiltering module. Negative values deactivate the blur.\nsortData (boolean,false) - Indicating whether the data is sorted; using sortperm() of Base Julia ","category":"page"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"(sortperm() computes a permutation of the array's indices that puts the array into sorted order). ","category":"page"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"ploterp (bool, false) - Indicating whether the plot should add a line plot below the ERP image, showing the mean of the data. If limits are set in the axis values both plots will be aligned.","category":"page"},{"location":"tutorials/erpimage/","page":"ERP Image","title":"ERP Image","text":"plot_erpimage(data;\n extra = (ploterp = true,),\n colorbar = (label = \"Voltage [µV]\",),\n visual = (colormap = :viridis, colorrange = (-40, 40)))\n","category":"page"},{"location":"tutorials/butterfly/#bfp_vis","page":"Butterfly Plot","title":"Butterfly Plot Visualization","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Here we discuss butterfly plot visualization. Make sure you have looked into the installation instructions.","category":"page"},{"location":"tutorials/butterfly/#Include-used-Modules","page":"Butterfly Plot","title":"Include used Modules","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"The following modules are necessary for following this tutorial:","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"using UnfoldMakie\nusing Unfold\nusing CairoMakie\nusing DataFrames","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Note that DataFramesMeta is also used here in order to be able to use @subset for testing (filtering).","category":"page"},{"location":"tutorials/butterfly/#Data","page":"Butterfly Plot","title":"Data","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"In case you want to try with different data, look at the Load Data section. ","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"We filter the data to make it more clearly represented:","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"include(\"../../example_data.jl\")\ndf, pos = example_data(\"TopoPlots.jl\")\nfirst(df,3)","category":"page"},{"location":"tutorials/butterfly/#Plot-Butterfly-Plots","page":"Butterfly Plot","title":"Plot Butterfly Plots","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"The following code will plot the default butterfly plot","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"plot_butterfly(df)","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"or if you provide the channel positions:","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"plot_butterfly(df;positions=pos)","category":"page"},{"location":"tutorials/butterfly/#Column-Mappings-for-Butterfly-Plots","page":"Butterfly Plot","title":"Column Mappings for Butterfly Plots","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Since butterfly plots use a DataFrame as an input, the library needs to know the names of the columns used for plotting. You can set these mapping values by plot_butterfly(...; mapping=(;:x=:time,)), that is, providing a NamedTuple (note the ; just after the opening-brackets","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"For more information about mapping values look into the Mapping Data section of the documentation.","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"While there are multiple default values, that are checked in that order if they exist in the DataFrame, a custom name might need to be choosen for:","category":"page"},{"location":"tutorials/butterfly/#x","page":"Butterfly Plot","title":"x","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Default is (:x, :time).","category":"page"},{"location":"tutorials/butterfly/#y","page":"Butterfly Plot","title":"y","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Default is (:y, :estimate, :yhat).","category":"page"},{"location":"tutorials/butterfly/#labels","page":"Butterfly Plot","title":"labels","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Default is (:labels, :label, :topoLabels, :sensor, :nothing)","category":"page"},{"location":"tutorials/butterfly/#Configurations-for-Butterfly-Plots","page":"Butterfly Plot","title":"Configurations for Butterfly Plots","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Here we look into possible options for configuring the butterfly plot visualization using (...;extra=(=,...). This is the list of unique configuration (extraData):","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"topoLegend (boolean)","category":"page"},{"location":"tutorials/butterfly/#topoLegend-(boolean)","page":"Butterfly Plot","title":"topoLegend (boolean)","text":"","category":"section"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Indicating whether the topo legend is displayed. Default is true.","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"For more general options look into the Plot Configuration section of the documentation.","category":"page"},{"location":"tutorials/butterfly/","page":"Butterfly Plot","title":"Butterfly Plot","text":"Since the configurations for line plots can be applied to butterfly plots as well. Here you can find the configurations for line plots, ","category":"page"},{"location":"tutorials/topoplot/#tp_vis","page":"Topo Plot","title":"Topo Plot Visualization","text":"","category":"section"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"Here we discuss topo plot visualization. Make sure you have looked into the installation instructions.","category":"page"},{"location":"tutorials/topoplot/#Include-used-Modules","page":"Topo Plot","title":"Include used Modules","text":"","category":"section"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"The following modules are necessary for following this tutorial:","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"using Unfold\nusing UnfoldMakie\nusing DataFrames\nusing CairoMakie\nusing TopoPlots","category":"page"},{"location":"tutorials/topoplot/#Plot-Topo-Plots","page":"Topo Plot","title":"Plot Topo Plots","text":"","category":"section"},{"location":"tutorials/topoplot/#Providing-the-Data","page":"Topo Plot","title":"Providing the Data","text":"","category":"section"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"data, positions = TopoPlots.example_data()","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"We select one datapoint, and the first enry of dimension 3 (the mean estimate, the others are p-value and std)","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"plot_topoplot(data[:,340,1]; positions = positions)","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"using DataFrames\ndf = DataFrame(:estimate => data[:,340,1])\nplot_topoplot(df; positions = positions)","category":"page"},{"location":"tutorials/topoplot/#Giving-the-Positions","page":"Topo Plot","title":"Giving the Positions","text":"","category":"section"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"Since the topo plot needs the positions of the sensors they have to be put into the drawing function. But there are multiple options (In order of prioritization):","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"Giving the positions directly: plot_topoplot(...; positions=[...])\nGiving the labels of the sensors: plot_topoplot(...; labels=[...])","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"To get the positions from the labels we use a database.","category":"page"},{"location":"tutorials/topoplot/#Column-Mappings-for-Topo-Plots","page":"Topo Plot","title":"Column Mappings for Topo Plots","text":"","category":"section"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"When using topo plots with a DataFrame as an input, the library needs to know the names of the columns used for plotting.","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"For more informations about mapping values look into the Mapping Data section of the documentation.","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"While there are multiple default values, that are checked in that order if they exist in the DataFrame, a custom name might need to be choosen for:","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"Note that only one of positions or labels have to be set to draw a topo plot. If both are set, positions takes precedence, labels might be used for labelling electrodes in TopoPlots.jl","category":"page"},{"location":"tutorials/topoplot/#(...,mapping(;))","page":"Topo Plot","title":"(...,mapping=(;))","text":"","category":"section"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":":y plotting function looks in the default columns of mapping","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"cfgDefault = UnfoldMakie.PlotConfig()\ncfgDefault.mapping.y","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"positions","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"cfgDefault.mapping.positions #hide","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"labels","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"cfgDefault.mapping.labels #hide","category":"page"},{"location":"tutorials/topoplot/#label_text-(boolean)","page":"Topo Plot","title":"label_text (boolean)","text":"","category":"section"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"Indicates whether label should drawn next to their position. Obviously the labels have to be provided: plot_topoplot(...; labels=[...])","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"plot_topoplot(...;visual=(;label_text=true))","category":"page"},{"location":"tutorials/topoplot/#label_scatter-(boolean)","page":"Topo Plot","title":"label_scatter (boolean)","text":"","category":"section"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"Indicates whether the dots should be drawn at the given positions.","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"plot_topoplot(...;visual=(;label_scatter=true))","category":"page"},{"location":"tutorials/topoplot/","page":"Topo Plot","title":"Topo Plot","text":"data, positions = TopoPlots.example_data()\nplot_topoplot(data[1:4,340,1]; visual = (; label_scatter = false), labels=[\"O1\", \"F2\", \"F3\", \"P4\"])","category":"page"},{"location":"tutorials/designmatrix/#dm_vis","page":"Designmatrix","title":"Designmatrix Visualization","text":"","category":"section"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"Here we discuss designmatrix visualization. Make sure you have looked into the installation instructions section. ","category":"page"},{"location":"tutorials/designmatrix/#Include-used-Modules","page":"Designmatrix","title":"Include used Modules","text":"","category":"section"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"The following modules are necessary for following this tutorial:","category":"page"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"using Unfold\nusing UnfoldMakie\nusing DataFrames\nusing CairoMakie","category":"page"},{"location":"tutorials/designmatrix/#Data","page":"Designmatrix","title":"Data","text":"","category":"section"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"In case you do not already have data, look at the Load Data section. ","category":"page"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"include(\"../../example_data.jl\")\nuf = example_data(\"UnfoldLinearModel\")\n","category":"page"},{"location":"tutorials/designmatrix/#Plot-Designmatrices","page":"Designmatrix","title":"Plot Designmatrices","text":"","category":"section"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"The following code will result in the default configuration. ","category":"page"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"plot_designmatrix(designmatrix(uf))","category":"page"},{"location":"tutorials/designmatrix/#plot_designmatrix(...;extra(namevalue,...).","page":"Designmatrix","title":"plot_designmatrix(...;extra=(=,...).","text":"","category":"section"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"sortData (boolean,false) - Indicating whether the data is sorted; using sortslices() of Base Julia. ","category":"page"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"In order to make the designmatrix easier to read, you may want to sort it.","category":"page"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"plot_designmatrix(designmatrix(uf);extra=(;sortData=true))","category":"page"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"standardizeData (boolean,false) - Indicating whether the data is standardized, mapping the values between 0 and 1. ","category":"page"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"xTicks (number,nothing)","category":"page"},{"location":"tutorials/designmatrix/","page":"Designmatrix","title":"Designmatrix","text":"Indicating the number of labels on the x-axis. Behavior if specified in configuration: - xTicks = 0: no labels are placed. - xTicks = 1: first possible label is placed. - xTicks = 2: first and last possible labels are placed. - 2 < xTicks < number of labels: xTicks-2 labels are placed between the first and last. - xTicks ≥ number of labels: all labels are placed.","category":"page"},{"location":"how_to/hide_deco/#ht_hide_deco","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"","category":"section"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"In this section we discuss how users are able to efficiently hide axis spines and decorations in their plots.","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"While it's possible to hide these axis decorations through setting the axis settings with axis=(;...), Makie.Axis features multiple variables for different aspects of the plot. This means that removing all decoration is only possible by setting a lot of variables each time.","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"Makie does feature methods like hidespines! and hidedecorations!, but the user might not have easy acces to the axis their plot is drawn in.","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"So instead these functions can be called by setting variables with layout = (;):","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"... layout = (\n ...\n hidespines = (),\n hidedecorations = ()\n)","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"Since these values mirror the input of the function, we can use an empty tuple to remove all decorations or spines respectively","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"And using hidespines = (:r, :t) results in the removal of the top and right border.","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"For more information on the input of these functions refer to the Makie dokumentation on Axis.","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"Since some plots hide features by default, the hiding can be reverted by setting the variables to nothing","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"plot_xxx(...;layout=(;\n hidespines = nothing,\n hidedecorations = nothing\n)","category":"page"},{"location":"how_to/hide_deco/","page":"Hide Axis Spines and Decorations","title":"Hide Axis Spines and Decorations","text":"(Image: Topoplot with all axis spines and decorations enabled)","category":"page"},{"location":"#UnfoldMakie-Documentation","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"","category":"section"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"This is the documentation of the UnfoldMakie module for the Julia programming language. ","category":"page"},{"location":"#About","page":"UnfoldMakie Documentation","title":"About","text":"","category":"section"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"UnfoldMakie aims to allow users to generate different types of visualizations. These include line plots, butterfly plots, designmatrices, parallel coordinates plots, ERP images and topo plots. Building on the Unfold and Makie Modules, it also grants users customizability through an input configuration on the plots.","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"As is apparent considering the types of possible visualizations, these config options try to enable users to create plots, that are helpful in the subject area of computational EEG. One such example is the possibility of using a topo plot as a legend for a line plot by allowing for multiple visualizations within one figure.","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"(Image: Coordinated Multiple Views)","category":"page"},{"location":"#Structure","page":"UnfoldMakie Documentation","title":"Structure","text":"","category":"section"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"For easy readability, the documentation is divided into sections users can inspect depending on their query.","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"The Tutorials: Setup section contains all information to get started including installation and how to aquire necessary data for testing if the user has none.","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"The Tutorials: Visualizations section summarizes all possible visualizations and how users can generate them. It also details their unique configuration options.","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"These visualizations are:","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"Designmatrices\nLine Plots\nButterfly Plots\nERP Images\nTopo Plots\nParallel Coordinate Plots","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"The Plot Configuration all segments of the config, detailing their contained attributes. The plot config is the prime interface allowing the user to access the different visualition options. As the options can be quite different in nature, the plot config is further split into categories. These segments are:","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"Axis Data\nColorbar Data\nExtra Data\nLayout Data\nLegend Data\nMapping Data\nVisual Data","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"The How To section features information on how to achieve specific goals or deal with specific problems.","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"These segments are:","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"Fix Parallel Coordinates Plot\nGenerate a Timeexpanded Designmatrix\nHide Axis Spines and Decorations\nInclude multiple Visualizations in one Figure\nShow out of Bounds Label","category":"page"},{"location":"#Used-Packages","page":"UnfoldMakie Documentation","title":"Used Packages","text":"","category":"section"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"Everything was tested with Julia v1.7.","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"The following module in their respective versions are used internally by UnfoldMakie:","category":"page"},{"location":"","page":"UnfoldMakie Documentation","title":"UnfoldMakie Documentation","text":"AlgebraOfGraphics v0.6.9\nCairoMakie v0.8.9\nColors v0.12.8\nColorSchemes v3.19.0\nDataFrames v1.3.4\nGeometryBasics v0.4.2\nImageFiltering v0.7.1\nMakie v0.17.9\nPipe v1.3.0\nPyMNE v0.1.2\nTopoPlots v0.1.0\nUnfold v0.3.11\nLinearAlgebra \nSparseArrays\nStatistics","category":"page"},{"location":"tutorials/installation/#install_instruct","page":"Installation","title":"Installation","text":"","category":"section"},{"location":"tutorials/installation/#Getting-Julia","page":"Installation","title":"Getting Julia","text":"","category":"section"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"You can install Julia by following the instructions from the official website. ","category":"page"},{"location":"tutorials/installation/#Setup-UnfoldMakie.jl","page":"Installation","title":"Setup UnfoldMakie.jl","text":"","category":"section"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"After installing Julia, you can execute the julia.exe. ","category":"page"},{"location":"tutorials/installation/#Generate-a-Project","page":"Installation","title":"Generate a Project","text":"","category":"section"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"If you do not yet have a project you can generate one. First you type ] into the Julia console to switch from julia to (@VERSION) pkg. Here you can generate a project by using the command: ","category":"page"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"generate \"FOLDER_PATH\"","category":"page"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"Note that the specific folder in which you want to generate the project does not already exist.","category":"page"},{"location":"tutorials/installation/#Activate-your-Project","page":"Installation","title":"Activate your Project","text":"","category":"section"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"Before you can add the necessary modules to use UnfoldMakie you have to activate your project in the (@VERSION) pkg environment. The command is: ","category":"page"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"activate \"FOLDER_PATH\"","category":"page"},{"location":"tutorials/installation/#Install-the-UnfoldMakie-Module","page":"Installation","title":"Install the UnfoldMakie Module","text":"","category":"section"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"When your project is activated you can add the module. The command is: ","category":"page"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"add UnfoldMakie","category":"page"},{"location":"tutorials/installation/#Using-the-Project-in-a-Notebook","page":"Installation","title":"Using the Project in a Notebook","text":"","category":"section"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"In case you want to use this generated project in a notebook (e.g. Pluto or Jupyter), you can activate this in the notebook in the following manner:","category":"page"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"begin\n using Pkg\n Pkg.activate(\"FOLDER_PATH\")\n Pkg.resolve()\nend","category":"page"},{"location":"tutorials/installation/","page":"Installation","title":"Installation","text":"Use slash / for the folder path. ","category":"page"}] } diff --git a/dev/tutorials/butterfly/index.html b/dev/tutorials/butterfly/index.html index 0d4558cd4..844a5217f 100644 --- a/dev/tutorials/butterfly/index.html +++ b/dev/tutorials/butterfly/index.html @@ -1,7 +1,7 @@ -Butterfly Plot · UnfoldMakie.jl

      Butterfly Plot Visualization

      Here we discuss butterfly plot visualization. Make sure you have looked into the installation instructions.

      Include used Modules

      The following modules are necessary for following this tutorial:

      using UnfoldMakie
      +Butterfly Plot · UnfoldMakie.jl

      Butterfly Plot Visualization

      Here we discuss butterfly plot visualization. Make sure you have looked into the installation instructions.

      Include used Modules

      The following modules are necessary for following this tutorial:

      using UnfoldMakie
       using Unfold
       using CairoMakie
       using DataFrames

      Note that DataFramesMeta is also used here in order to be able to use @subset for testing (filtering).

      Data

      In case you want to try with different data, look at the Load Data section.

      We filter the data to make it more clearly represented:

      include("../../example_data.jl")
       df, pos = example_data("TopoPlots.jl")
      -first(df,3)
      3×7 DataFrame
      RowestimatetimechannelcoefnametopoPositionssepval
      Float64Float64Int64StringAnyFloat64Float64
      10.020321-0.31A(0.493714, 0.544031)0.1228750.266091
      20.017548-0.2981A(0.493714, 0.544031)0.1243450.29664
      30.0150747-0.2961A(0.493714, 0.544031)0.1248280.323592

      Plot Butterfly Plots

      The following code will plot the default butterfly plot

      plot_butterfly(df)

      or if you provide the channel positions:

      plot_butterfly(df;positions=pos)

      Column Mappings for Butterfly Plots

      Since butterfly plots use a DataFrame as an input, the library needs to know the names of the columns used for plotting. You can set these mapping values by plot_butterfly(...; mapping=(;:x=:time,)), that is, providing a NamedTuple (note the ; just after the opening-brackets

      For more information about mapping values look into the Mapping Data section of the documentation.

      While there are multiple default values, that are checked in that order if they exist in the DataFrame, a custom name might need to be choosen for:

      x

      Default is (:x, :time).

      y

      Default is (:y, :estimate, :yhat).

      labels

      Default is (:labels, :label, :topoLabels, :sensor, :nothing)

      Configurations for Butterfly Plots

      Here we look into possible options for configuring the butterfly plot visualization using (...;extra=(<name>=<value>,...). This is the list of unique configuration (extraData):

      • topoLegend (boolean)

      topoLegend (boolean)

      Indicating whether the topo legend is displayed. Default is true.

      For more general options look into the Plot Configuration section of the documentation.

      Since the configurations for line plots can be applied to butterfly plots as well. Here you can find the configurations for line plots,

      +first(df,3)
      3×7 DataFrame
      RowestimatetimechannelcoefnametopoPositionssepval
      Float64Float64Int64StringAnyFloat64Float64
      10.020321-0.31A(0.493714, 0.544031)0.1228750.266091
      20.017548-0.2981A(0.493714, 0.544031)0.1243450.29664
      30.0150747-0.2961A(0.493714, 0.544031)0.1248280.323592

      Plot Butterfly Plots

      The following code will plot the default butterfly plot

      plot_butterfly(df)

      or if you provide the channel positions:

      plot_butterfly(df;positions=pos)

      Column Mappings for Butterfly Plots

      Since butterfly plots use a DataFrame as an input, the library needs to know the names of the columns used for plotting. You can set these mapping values by plot_butterfly(...; mapping=(;:x=:time,)), that is, providing a NamedTuple (note the ; just after the opening-brackets

      For more information about mapping values look into the Mapping Data section of the documentation.

      While there are multiple default values, that are checked in that order if they exist in the DataFrame, a custom name might need to be choosen for:

      x

      Default is (:x, :time).

      y

      Default is (:y, :estimate, :yhat).

      labels

      Default is (:labels, :label, :topoLabels, :sensor, :nothing)

      Configurations for Butterfly Plots

      Here we look into possible options for configuring the butterfly plot visualization using (...;extra=(<name>=<value>,...). This is the list of unique configuration (extraData):

      • topoLegend (boolean)

      topoLegend (boolean)

      Indicating whether the topo legend is displayed. Default is true.

      For more general options look into the Plot Configuration section of the documentation.

      Since the configurations for line plots can be applied to butterfly plots as well. Here you can find the configurations for line plots,

      diff --git a/dev/tutorials/designmatrix/index.html b/dev/tutorials/designmatrix/index.html index 418eb5407..165f295d8 100644 --- a/dev/tutorials/designmatrix/index.html +++ b/dev/tutorials/designmatrix/index.html @@ -1,5 +1,5 @@ -Designmatrix · UnfoldMakie.jl

      Designmatrix Visualization

      Here we discuss designmatrix visualization. Make sure you have looked into the installation instructions section.

      Include used Modules

      The following modules are necessary for following this tutorial:

      using Unfold
      +Designmatrix · UnfoldMakie.jl

      Designmatrix Visualization

      Here we discuss designmatrix visualization. Make sure you have looked into the installation instructions section.

      Include used Modules

      The following modules are necessary for following this tutorial:

      using Unfold
       using UnfoldMakie
       using DataFrames
       using CairoMakie

      Data

      In case you do not already have data, look at the Load Data section.

      include("../../example_data.jl")
      @@ -16,4 +16,4 @@
       
           coeftable(uf) 		(returns tidy result dataframe) 
       
      -

      Plot Designmatrices

      The following code will result in the default configuration.

      plot_designmatrix(designmatrix(uf))

      plot_designmatrix(...;extra=(<name>=<value>,...).

      • sortData (boolean,false) - Indicating whether the data is sorted; using sortslices() of Base Julia.

      In order to make the designmatrix easier to read, you may want to sort it.

      plot_designmatrix(designmatrix(uf);extra=(;sortData=true))
      • standardizeData (boolean,false) - Indicating whether the data is standardized, mapping the values between 0 and 1.
      • xTicks (number,nothing)

      Indicating the number of labels on the x-axis. Behavior if specified in configuration: - xTicks = 0: no labels are placed. - xTicks = 1: first possible label is placed. - xTicks = 2: first and last possible labels are placed. - 2 < xTicks < number of labels: xTicks-2 labels are placed between the first and last. - xTicks ≥ number of labels: all labels are placed.

      +

      Plot Designmatrices

      The following code will result in the default configuration.

      plot_designmatrix(designmatrix(uf))

      plot_designmatrix(...;extra=(<name>=<value>,...).

      • sortData (boolean,false) - Indicating whether the data is sorted; using sortslices() of Base Julia.

      In order to make the designmatrix easier to read, you may want to sort it.

      plot_designmatrix(designmatrix(uf);extra=(;sortData=true))
      • standardizeData (boolean,false) - Indicating whether the data is standardized, mapping the values between 0 and 1.
      • xTicks (number,nothing)

      Indicating the number of labels on the x-axis. Behavior if specified in configuration: - xTicks = 0: no labels are placed. - xTicks = 1: first possible label is placed. - xTicks = 2: first and last possible labels are placed. - 2 < xTicks < number of labels: xTicks-2 labels are placed between the first and last. - xTicks ≥ number of labels: all labels are placed.

      diff --git a/dev/tutorials/erpimage/index.html b/dev/tutorials/erpimage/index.html index bd3c08f6b..4764e3783 100644 --- a/dev/tutorials/erpimage/index.html +++ b/dev/tutorials/erpimage/index.html @@ -1,5 +1,5 @@ -ERP Image · UnfoldMakie.jl

      ERP Image Visualization

      Here we discuss ERP image visualization. Make sure you have looked into the installation instructions.

      Include used Modules

      The following modules are necessary for following this tutorial:

      using Unfold
      +ERP Image · UnfoldMakie.jl

      ERP Image Visualization

      Here we discuss ERP image visualization. Make sure you have looked into the installation instructions.

      Include used Modules

      The following modules are necessary for following this tutorial:

      using Unfold
       using UnfoldMakie
       using CairoMakie
       using UnfoldSim
      @@ -7,4 +7,4 @@
       plot_erpimage(data)

      Column Mappings for ERP Images

      Since ERP images use a Matrix as an input, the library does not need any informations about the mapping.

      extra=(;)

      • erpBlur (number,10 ) - Is a number indicating how much blur is applied to the image; using Gaussian blur of the ImageFiltering module. Negative values deactivate the blur.

      • sortData (boolean,false) - Indicating whether the data is sorted; using sortperm() of Base Julia

      (sortperm() computes a permutation of the array's indices that puts the array into sorted order).

      • ploterp (bool, false) - Indicating whether the plot should add a line plot below the ERP image, showing the mean of the data. If limits are set in the axis values both plots will be aligned.
      plot_erpimage(data;
           extra = (ploterp = true,),
           colorbar = (label = "Voltage [µV]",),
      -    visual = (colormap = :viridis, colorrange = (-40, 40)))
      + visual = (colormap = :viridis, colorrange = (-40, 40)))
      diff --git a/dev/tutorials/installation/index.html b/dev/tutorials/installation/index.html index 5a1775168..fb1f49d06 100644 --- a/dev/tutorials/installation/index.html +++ b/dev/tutorials/installation/index.html @@ -1,6 +1,6 @@ -Installation · UnfoldMakie.jl

      Installation

      Getting Julia

      You can install Julia by following the instructions from the official website.

      Setup UnfoldMakie.jl

      After installing Julia, you can execute the julia.exe.

      Generate a Project

      If you do not yet have a project you can generate one. First you type ] into the Julia console to switch from julia to (@VERSION) pkg. Here you can generate a project by using the command:

      generate "FOLDER_PATH"

      Note that the specific folder in which you want to generate the project does not already exist.

      Activate your Project

      Before you can add the necessary modules to use UnfoldMakie you have to activate your project in the (@VERSION) pkg environment. The command is:

      activate "FOLDER_PATH"

      Install the UnfoldMakie Module

      When your project is activated you can add the module. The command is:

      add UnfoldMakie

      Using the Project in a Notebook

      In case you want to use this generated project in a notebook (e.g. Pluto or Jupyter), you can activate this in the notebook in the following manner:

      begin
      +Installation · UnfoldMakie.jl

      Installation

      Getting Julia

      You can install Julia by following the instructions from the official website.

      Setup UnfoldMakie.jl

      After installing Julia, you can execute the julia.exe.

      Generate a Project

      If you do not yet have a project you can generate one. First you type ] into the Julia console to switch from julia to (@VERSION) pkg. Here you can generate a project by using the command:

      generate "FOLDER_PATH"

      Note that the specific folder in which you want to generate the project does not already exist.

      Activate your Project

      Before you can add the necessary modules to use UnfoldMakie you have to activate your project in the (@VERSION) pkg environment. The command is:

      activate "FOLDER_PATH"

      Install the UnfoldMakie Module

      When your project is activated you can add the module. The command is:

      add UnfoldMakie

      Using the Project in a Notebook

      In case you want to use this generated project in a notebook (e.g. Pluto or Jupyter), you can activate this in the notebook in the following manner:

      begin
           using Pkg
           Pkg.activate("FOLDER_PATH")
           Pkg.resolve()
      -end

      Use slash / for the folder path.

      +end

      Use slash / for the folder path.

      diff --git a/dev/tutorials/parallelcoordinates/index.html b/dev/tutorials/parallelcoordinates/index.html index 50fd4d916..814829795 100644 --- a/dev/tutorials/parallelcoordinates/index.html +++ b/dev/tutorials/parallelcoordinates/index.html @@ -1,5 +1,5 @@ -Parallel Coordinates Plot · UnfoldMakie.jl

      Parallel Coordinates Plot

      Here we discuss parallel coordinates plot (PCP) visualization.

      Include used Modules

      The following modules are necessary for following this tutorial:

      using Unfold
      +Parallel Coordinates Plot · UnfoldMakie.jl

      Parallel Coordinates Plot

      Here we discuss parallel coordinates plot (PCP) visualization.

      Include used Modules

      The following modules are necessary for following this tutorial:

      using Unfold
       using UnfoldMakie
       using DataFrames
       using CairoMakie

      Data

      In case you do not already have data, look at the Load Data section.

      We use the test data of erpcore-N170.jld2.

      include("../../example_data.jl")
      @@ -24,4 +24,4 @@
        25599 │  0.112385       0.496       64  A         (0.719221, 0.888091)  0.262
        25600 │  0.109979       0.498       64  A         (0.719221, 0.888091)  0.258
                                                       2 columns and 25585 rows omitted, Point{2, Float32}[[0.49371386, 0.5440313], [0.5630452, 0.50400287], [0.5630452, 0.4239459], [0.49371386, 0.38391745], [0.4243825, 0.4239459], [0.4243825, 0.50400287], [0.5378472, 0.6178857], [0.61455333, 0.56901854], [0.6522695, 0.4862579], [0.6388263, 0.39630732]  …  [0.93907887, 0.6439135], [0.9450873, 0.29968786], [0.8333667, 0.12432156], [0.61803544, 1.9428903f-16], [0.3693923, 2.7755576f-17], [0.15406103, 0.12432156], [0.029739477, 0.3396528], [0.04834886, 0.6439135], [0.26820713, 0.88809085], [0.7192206, 0.88809085]])

      Plot PCPs

      plot_parallelcoordinates(results_plot,[5,3,2]; # this selects channel 5,3 & 2
      -    mapping = (color = :coefname, y = :estimate))
      Important

      the following is still outdated...

      Column Mappings for PCPs

      Since PCPs use a DataFrame as an input, the library needs to know the names of the columns used for plotting.

      For more informations about mapping values, look into the Mapping Data section of the documentation.

      While there are multiple default values that are checked in that order if they exist in the DataFrame, a custom name might need to be choosen for:

      y

      Default is (:y, :estimate, :yhat).

      channel

      Default is :channel.

      color

      XXX Default is :coef.

      time

      Default is :time.

      + mapping = (color = :coefname, y = :estimate))
      Important

      the following is still outdated...

      Column Mappings for PCPs

      Since PCPs use a DataFrame as an input, the library needs to know the names of the columns used for plotting.

      For more informations about mapping values, look into the Mapping Data section of the documentation.

      While there are multiple default values that are checked in that order if they exist in the DataFrame, a custom name might need to be choosen for:

      y

      Default is (:y, :estimate, :yhat).

      channel

      Default is :channel.

      color

      XXX Default is :coef.

      time

      Default is :time.

      diff --git a/dev/tutorials/topoplot/index.html b/dev/tutorials/topoplot/index.html index c7a1ddf35..79abb59aa 100644 --- a/dev/tutorials/topoplot/index.html +++ b/dev/tutorials/topoplot/index.html @@ -1,5 +1,5 @@ -Topo Plot · UnfoldMakie.jl

      Topo Plot Visualization

      Here we discuss topo plot visualization. Make sure you have looked into the installation instructions.

      Include used Modules

      The following modules are necessary for following this tutorial:

      using Unfold
      +Topo Plot · UnfoldMakie.jl

      Topo Plot Visualization

      Here we discuss topo plot visualization. Make sure you have looked into the installation instructions.

      Include used Modules

      The following modules are necessary for following this tutorial:

      using Unfold
       using UnfoldMakie
       using DataFrames
       using CairoMakie
      @@ -7,4 +7,4 @@
       df = DataFrame(:estimate => data[:,340,1])
       plot_topoplot(df; positions = positions)

      Giving the Positions

      Since the topo plot needs the positions of the sensors they have to be put into the drawing function. But there are multiple options (In order of prioritization):

      • Giving the positions directly: plot_topoplot(...; positions=[...])
      • Giving the labels of the sensors: plot_topoplot(...; labels=[...])

      To get the positions from the labels we use a database.

      Column Mappings for Topo Plots

      When using topo plots with a DataFrame as an input, the library needs to know the names of the columns used for plotting.

      For more informations about mapping values look into the Mapping Data section of the documentation.

      While there are multiple default values, that are checked in that order if they exist in the DataFrame, a custom name might need to be choosen for:

      Note that only one of positions or labels have to be set to draw a topo plot. If both are set, positions takes precedence, labels might be used for labelling electrodes in TopoPlots.jl

      (...,mapping=(;))

      :y plotting function looks in the default columns of mapping

      cfgDefault = UnfoldMakie.PlotConfig()
       cfgDefault.mapping.y
      (:estimate, :yhat, :y)

      positions

      cfgDefault.mapping.positions #hide

      labels

      cfgDefault.mapping.labels #hide

      label_text (boolean)

      Indicates whether label should drawn next to their position. Obviously the labels have to be provided: plot_topoplot(...; labels=[...])

      plot_topoplot(...;visual=(;label_text=true))

      label_scatter (boolean)

      Indicates whether the dots should be drawn at the given positions.

      plot_topoplot(...;visual=(;label_scatter=true))

      data, positions = TopoPlots.example_data()
      -plot_topoplot(data[1:4,340,1]; visual = (; label_scatter = false), labels=["O1", "F2", "F3", "P4"])
      +plot_topoplot(data[1:4,340,1]; visual = (; label_scatter = false), labels=["O1", "F2", "F3", "P4"])
      diff --git a/dev/tutorials/topoplotseries/index.html b/dev/tutorials/topoplotseries/index.html index d3775361d..5518f1889 100644 --- a/dev/tutorials/topoplotseries/index.html +++ b/dev/tutorials/topoplotseries/index.html @@ -1,8 +1,8 @@ -Topo Plot Series · UnfoldMakie.jl

      Topo Plot SeriesVisualization

      Include used Modules

      The following modules are necessary for following this tutorial:

      using Unfold
      +Topo Plot Series · UnfoldMakie.jl

      Topo Plot SeriesVisualization

      Include used Modules

      The following modules are necessary for following this tutorial:

      using Unfold
       using UnfoldMakie
       using DataFrames
       using CairoMakie
       using TopoPlots

      Plot Topo Plots Series

      Giving the Data

      In case you do not already have data, you can get example data from the TopoPlots module. You can do it like this:

      data, positions = TopoPlots.example_data()
       df = UnfoldMakie.eeg_matrix_to_dataframe(data[:,:,1], string.(1:length(positions)));
      Δbin = 80
      -plot_topoplotseries(df, Δbin; positions = positions)

      Positions

      You can give either positions, or labels. If both are provided, positions have priority

      plot_toposeries(...;mapping=(;key=value))

      mapping=(:y=(:estimate,:yhat,:y))

      visual=(;)

      label_text (boolean, false) Indicates whether label should drawn next to their position. The labels have to be given into the function seperately:

      Important

      currently bugged

      label_scatter (boolean, true) - Indicates whether the dots should be drawn at the given positions.

      +plot_topoplotseries(df, Δbin; positions = positions)

      Positions

      You can give either positions, or labels. If both are provided, positions have priority

      plot_toposeries(...;mapping=(;key=value))

      mapping=(:y=(:estimate,:yhat,:y))

      visual=(;)

      label_text (boolean, false) Indicates whether label should drawn next to their position. The labels have to be given into the function seperately:

      Important

      currently bugged

      label_scatter (boolean, true) - Indicates whether the dots should be drawn at the given positions.