diff --git a/.gitignore b/.gitignore index 3d73f626..1c0a3da6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ .vscode/ /test/Manifest.toml /docs/Manifest.toml - +/docs/.CondaPkg /Manifest.toml /docs/build/ /docs/src/generated diff --git a/docs/literate/plot_results_styling.jl b/docs/literate/plot_results_styling.jl index 69699913..4ac89b26 100644 --- a/docs/literate/plot_results_styling.jl +++ b/docs/literate/plot_results_styling.jl @@ -21,7 +21,7 @@ results = coeftable(m); nothing # # Styling your plot # ## Mapping's # everything you can put in a mapping(...) AoG group can be modified, for instance: -plot_results(results,linestyle=:coefname) +plot_results(results,mapping=(;linestyle=:coefname)) # ## Adding P-values # You can provide a dataframe with columns (must): `:from`,`:to`,future versions might allow a `:pvalue` column diff --git a/docs/literate/reference/positions.md b/docs/literate/reference/positions.md deleted file mode 100644 index a9eb32b8..00000000 --- a/docs/literate/reference/positions.md +++ /dev/null @@ -1,46 +0,0 @@ -```@meta -EditURL = "positions.jl" -``` - -````@example positions -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) - -````@example positions -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 = to_positions(fake_evoked) -```` - -# project from 3D electrode locations to 2D - -````@example positions -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](https://github.com/fredrikekre/Literate.jl).* - diff --git a/docs/make.jl b/docs/make.jl index 1844d78a..0e98ac0b 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -49,10 +49,9 @@ makedocs(; ], "How To" => [ "Butterfly Colormap" => "how_to/position2color.md", - "Fix Parallel Coordinates Plot" => "how_to/fix_pcp.md", "Hide Axis Spines and Decorations" => "how_to/hide_deco.md", "Include multiple Visualizations in one Figure" => "how_to/mult_vis_in_fig.md", - "Show out of Bounds Label" => "how_to/show_oob_labels.md", + "Designmatrix: Show out of Bounds Label" => "how_to/show_oob_labels.md", ], "Reference" => [ "Convert 3D positions / montages to 2D layouts" => "generated/reference/positions.md", diff --git a/docs/src/how_to/fix_pcp.md b/docs/src/how_to/fix_pcp.md deleted file mode 100644 index 3a08da44..00000000 --- a/docs/src/how_to/fix_pcp.md +++ /dev/null @@ -1,33 +0,0 @@ -# [Fix Parallel Coordinates Plot](@id ht_fpcp) - -Since Makie doesn't have a native function to draw PCPs, our version is somewhat experimental for general use. - -Under certain circumstances the PCP is not visualized correctly. -This leads to truncated edges of the PCP and unused space. - - -Since the plot could have more space above and below, we can change the aspect ratio of the plot with: -``` -... -pc_aspect_ratio = 1, -... -``` - -The cut off or overlap at each side can be fixed with: -``` -... -pc_right_padding = 15, -pc_left_padding = 45, -pc_top_padding = 50, -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 diff --git a/docs/src/how_to/mult_vis_in_fig.md b/docs/src/how_to/mult_vis_in_fig.md index 1df4c4f5..27e2882e 100644 --- a/docs/src/how_to/mult_vis_in_fig.md +++ b/docs/src/how_to/mult_vis_in_fig.md @@ -78,7 +78,7 @@ plot_erp!(f[2, 4:5], res_effects; categorical_color=false, categorical_group=tru legend=(; nbanks=2), layout=(; show_legend=true, legend_position=:right)) -plot_parallelcoordinates!(f[3, 2:3], uf_5chan, [1, 2, 3, 4, 5]; mapping=(; color=:coefname), +plot_parallelcoordinates(f[3, 2:3], uf_5chan; mapping=(; color=:coefname), layout=(; legend_position=:bottom)) plot_erpimage!(f[1, 4:5], times, d_singletrial) diff --git a/test/test_complexplots.jl b/test/test_complexplots.jl index b570e0d1..587f4d8c 100644 --- a/test/test_complexplots.jl +++ b/test/test_complexplots.jl @@ -42,7 +42,7 @@ layout = (; use_colorbar=true)) plot_erpgrid!(ge, data[:, :, 1], positions) plot_erpimage!(gf, times, d_singletrial) - plot_parallelcoordinates!(gh, uf_5chan, [1, 2, 3, 4, 5]; + plot_parallelcoordinates(gh, uf_5chan; mapping=(; color=:coefname), layout=(; legend_position=:bottom), legend=(; tellwidth =false)) for (label, layout) in zip(["A", "B", "C", "D", "E", "F", "G", "H"], [ga, gb, gc, gd, ge, gf, gg, gh]) @@ -88,7 +88,7 @@ end times = -0.099609375:0.001953125:1.0 plot_erpimage!(f[3, 2], times, d_singletrial) - plot_parallelcoordinates!(f[4, 2], uf_5chan, [1, 2, 3, 4, 5]; mapping=(; color=:coefname), + plot_parallelcoordinates(f[4, 2], uf_5chan; mapping=(; color=:coefname), layout=(; legend_position=:bottom), legend=(; tellwidth =false)) for (label, layout) in zip(["A", "B", "C", "D", "E", "F", "G", "H"], @@ -142,7 +142,7 @@ end legend=(; nbanks=2), layout=(; show_legend=true, legend_position=:right)) - plot_parallelcoordinates!(f[3, 2:3], uf_5chan, [1, 2, 3, 4, 5]; mapping=(; color=:coefname), layout=(; legend_position=:bottom)) + plot_parallelcoordinates(f[3, 2:3], uf_5chan; mapping=(; color=:coefname), layout=(; legend_position=:bottom)) plot_erpimage!(f[1, 4:5], times, d_singletrial) plot_circulareegtopoplot!(f[3:4, 4:5], d_topo[in.(d_topo.time, Ref(-0.3:0.1:0.5)), :];