-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"8 plots -2" #101
"8 plots -2" #101
Changes from 13 commits
3f31f6f
6f4e1dd
e255166
19884ab
5fe7c02
d348202
5e8772f
1fabe0a
8f5a305
a3a38e0
7daf0b9
05515f9
3fb638e
7c04981
b40c64a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using Pkg | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont understand this file - do we need it? If I understand correctly the auto-format github action should resolve this - it will come soon :S (not in my hands, the maintainer needs to update something) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no it is here accidentally |
||
#Pkg.activate("/store/users/mikheev/projects/unfold_dev/") | ||
#Pkg.activate("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie") | ||
Pkg.status() | ||
|
||
Pkg.instantiate() | ||
Pkg.resolve() | ||
|
||
|
||
pwd() | ||
#include("dev/UnfoldMakie/test/test_toposeries.jl") | ||
#include("test/test_toposeries.jl") | ||
|
||
|
||
Pkg.activate("/store/users/mikheev/projects/unfold_dev/") | ||
#Pkg.activate("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/test/") | ||
|
||
include("test/setup.jl") | ||
using UnfoldMakie | ||
|
||
include("test/test_toposeries.jl") | ||
#include("test/test_plot_circulareegtopoplot.jl") | ||
|
||
include("test/runtests.jl") | ||
|
||
include("test/test_erpimage.jl") | ||
include("test/test_topoplot.jl") | ||
include("test/test_all.jl") | ||
|
||
# docs] | ||
|
||
#Pkg.activate("/store/users/mikheev/projects/unfold_dev/UnfoldMakie/docs/") | ||
#include("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/docs/make.jl") | ||
|
||
using JuliaFormatter | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/src/eeg_series.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/src/plot_circulareegtopoplot.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/src/plot_designmatrix.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/src/plot_erp.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/src/plot_erpimage.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/src/plot_parallelcoordinates.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/src/plot_topoplot.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/src/plot_topoplotseries.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/src/plot_erpgrid.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/src/plot_channelimage.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/src/plotconfig.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/src/UnfoldMakie.jl") | ||
|
||
|
||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/docs/src/tutorials/butterfly.md") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/docs/src/literate/tutorials/circTopo.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/docs/src/literate/tutorials/erp.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/docs/example_data.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/docs/make.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/docs/run_liveserver.jl") | ||
|
||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/test/test_dm.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/test/test_erp.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/test/test_erpimage.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/test/test_erpgrid.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/test/test_butterfly.jl") | ||
format_file("/store/users/mikheev/projects/unfold_dev/dev/UnfoldMakie/test/test_toposeries.jl") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
""" | ||
plot_channelimage!(f::Union{GridPosition, GridLayout, Figure}, data::Matrix{<:Real}, position::Vector{Point{2,Float32}}, ch_names::Vector{String}; kwargs...) | ||
plot_channelimage(data::Matrix{<:Real}, position::Vector{Point{2,Float32}}, ch_names::Vector{String}; kwargs...) | ||
|
||
Channel image | ||
|
||
## Arguments: | ||
|
||
- `f::Union{GridPosition, GridLayout, Figure}`: Figure, GridLayout or GridPosition that the plot should be drawn into. | ||
- `data::DataFrame`: DataFrame with data. | ||
- `position` (Vector{Point{2,Float32}}): a vector with EEG layout coordinates. | ||
- `ch_names` (Vector{String}): vector with channel names. | ||
|
||
$(_docstring(:channelimage)) | ||
|
||
## Return Value: | ||
A figure displaying channel image | ||
|
||
""" | ||
|
||
plot_channelimage(data::Matrix{<:Real}, position::Vector{Point{2,Float32}}, ch_names::Vector{String}; kwargs...) = | ||
plot_channelimage!(Figure(), data, position, ch_names; kwargs...) | ||
|
||
function plot_channelimage!( | ||
f::Union{GridPosition,GridLayout,Figure}, | ||
data::Matrix{<:Real}, | ||
position::Vector{Point{2,Float32}}, | ||
ch_names::Vector{String}; | ||
kwargs..., | ||
) | ||
config = PlotConfig(:channelimage) | ||
config_kwargs!(config; kwargs...) | ||
|
||
|
||
x = [i[1] for i in position] | ||
y = [i[2] for i in position] | ||
|
||
x = round.(x; digits = 2) | ||
y = Integer.(round.((y .- mean(y)) * 20)) * -1 | ||
x = Integer.(round.((x .- mean(x)) * 20)) | ||
d = zip(x, y, ch_names, 1:20) | ||
a = sort!(DataFrame(d), [:2, :1], rev = [true, false]) | ||
b = a[!, :4] | ||
c = a[!, :3] | ||
c = [string(x) for x in c] | ||
|
||
ix = range(-0.3, 1.2, length = size(data, 2)) | ||
iy = 1:20 | ||
iz = mean(data, dims = 3)[b, :, 1]' | ||
|
||
gin = f[1, 1] = GridLayout() | ||
ax = Axis(gin[1, 1], xlabel = config.axis.xlabel, ylabel = config.axis.ylabel) | ||
hm = Makie.heatmap!(ix, iy, iz, colormap = config.visual.colormap) | ||
ax.yticks = iy | ||
ax.ytickformat = xc -> c | ||
ax.yticklabelsize = config.axis.yticklabelsize | ||
|
||
Makie.Colorbar(gin[1, 2], hm, label = config.colorbar.label, labelrotation = config.colorbar.labelrotation) | ||
return f | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we include this into https://github.com/unfoldtoolbox/UnfoldMakie.jl/blob/main/docs/example_data.jl ?
And is this different to the examples used there?
That would make it nicer imho :)