Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polar plot for cyclical splines #81

Open
behinger opened this issue Dec 17, 2019 · 0 comments
Open

polar plot for cyclical splines #81

behinger opened this issue Dec 17, 2019 · 0 comments

Comments

@behinger
Copy link
Member

potential visualization of circular spline regressor

d2nd2 = subjectwise_getparam(d2nd,[0.6 5 10 15],linspace(0,2*pi,9),1);
% polar plot of time-averaged values
% to be continued (works but is ugly/unpracticle)
%%
plotParam = 'angle';

time = [-0.12 -0.05;
    0.06 0.11;
    0.12 0.14;
    0.18 0.28];
ix = strcmp(plotParam,{d2nd2.param.name});
figure
cmap = cbrewer('qual','Set1',size(time,1));
for t= 1:size(time,1)
    data = d2nd2.beta(strcmp('PO7',{d2nd2.chanlocs.labels}),d2nd2.times>time(t,1) & d2nd2.times<=time(t,2),ix,:);
    
    % figure
    %
    %  customstat = @(y)([trimmean(y,2.5);bootci(1000,{@(ty)trimmean(ty,2.5),y-mean(y,1)},'alpha',0.05)+mean(y,1)]);
    cousineauBootCI = @(y)([trimmean(y,2.5);bootci(1000,{@(ty)trimmean(ty,2.5),y-mean(y,2)},'alpha',0.05)-mean(y-mean(y,2),1) + trimmean(y,2.5)]);
    g = gramm('x',[d2nd2.param(ix).value],'y',squeeze(mean(data,2))')%
    g.stat_summary('type',cousineauBootCI,'geom','lines')
    % g.stat_summary('type','bootci','geom','lines')
    % g.geom_line('alpha',0.3)
    
    g.set_color_options('map',cmap(t,:));
    g.set_polar('maxy',5)
    g.draw()
    %     pause
end

results in a plot like this

grafik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant