Commit 71d65b07 authored by Mike Cichonski's avatar Mike Cichonski
Browse files

vised plot optimizations

parent b5d89dab
......@@ -1178,7 +1178,8 @@ else
end;
if strcmpi(g.plotdata2, 'off')
axes(ax1)
cla
obj_2_clear = findobj(ax1,'tag','text');
cla(obj_2_clear); % clear all except text
end;
oldspacing = g.spacing;
......@@ -1218,13 +1219,13 @@ else
plot(plot_p1, plot_p2(ci),'<', ...
'MarkerEdgeColor', plot_colour, ...
'MarkerFaceColor', plot_colour, ...
'MarkerSize', 8);
'MarkerSize', 8,'tag',['marker_' num2str(chan_inds(ci))]);
%plot data
if fi==manual_mark_ind || ~g.chan_marks_struct(manual_mark_ind).flags(chan_inds(ci));
tmp_offset=(g.chans-(chan_inds(ci)-1))*g.spacing-(meandata(chan_inds(ci)));
line(1:length(low_high_range), ...
data(chan_inds(ci),low_high_range) + tmp_offset, zlowhigh, ...
'color', tmp_color, 'clipping','on');
'color', tmp_color, 'clipping','on','tag',['line_' num2str(chan_inds(ci))]);
end
end
end
......@@ -1262,8 +1263,10 @@ else
'CData',cdat, ...
'LineStyle','none');
alpha(sh,g.marks_col_alpha);
text(figdim(2),ylims(1)+inter_time_mark_offset*tmi+(time_marks_offset(i))-(inter_time_mark_offset*length(g.time_marks_struct)), ...
g.time_marks_struct(tmi).label,'color',g.time_marks_struct(tmi).color,'interpreter','none');
if p1==0;
text(figdim(2),ylims(1)+inter_time_mark_offset*tmi+(time_marks_offset(i))-(inter_time_mark_offset*length(g.time_marks_struct)), ...
g.time_marks_struct(tmi).label,'color',g.time_marks_struct(tmi).color,'interpreter','none','tag','text');
end
end
end
colormap(cmap);
......@@ -1279,7 +1282,7 @@ else
for ci=1:length(chan_inds);
tmp_offset=(g.chans-(chan_inds(ci)-1))*g.spacing-(meandata(chan_inds(ci)));
line(1:length(lowlim:highlim),data(chan_inds(ci),lowlim:highlim) + tmp_offset, ones(1,length(lowlim:highlim))*100, ...
'color', tmp_color, 'clipping','on');
'color', tmp_color, 'clipping','on','tag',['line_' num2str(chan_inds(ci))]);
end
% plot channels whose order is > 0.
......@@ -1301,12 +1304,12 @@ else
plot(1+tag_x_int*mark_inds(fi),(g.chans-(chan_inds(ci)-1))*g.spacing,'<', ...
'MarkerEdgeColor', g.chan_marks_struct(mark_inds(fi)).tag_color, ...
'MarkerFaceColor', g.chan_marks_struct(mark_inds(fi)).tag_color, ...
'MarkerSize',8);
'MarkerSize',8,'tag',['marker_' num2str(chan_inds(ci))]);
%plot data
if ~g.chan_marks_struct(manual_mark_ind).flags(chan_inds(ci))
tmp_offset=(g.chans-(chan_inds(ci)-1))*g.spacing-(meandata(chan_inds(ci)));
line(1:length(lowlim:highlim),data(chan_inds(ci),lowlim:highlim) + tmp_offset, ones(1,length(lowlim:highlim))*1000, ...
'color', tmp_color, 'clipping','on');
'color', tmp_color, 'clipping','on','tag',['line_' num2str(chan_inds(ci))]);
end
end
end
......@@ -1361,7 +1364,7 @@ else
else
ve_eegplot('drawb');
end;
case 'drawb' % Draw background ******************************************************
% Redraw EEG and change position
......
......@@ -184,16 +184,57 @@ if nargin < 5
% g.eloc_file(g.eventedit.ChanIndex).badchan=0;
%end
mark_ind=find(strcmp(g.quick_chanflag,{udf.chan_marks_struct.label}));
%calculate x ifinterval for channel tags...
figdim=axis;
tag_x_int=(figdim(2)-1)*udf.inter_tag_int;
chan_inds = linspace(udf.chans,1,udf.chans);
plot_p1 = 1+tag_x_int*mark_ind;
plot_p2 = (udf.chans-(chan_inds-1))*udf.spacing;
if udf.chan_marks_struct(mark_ind).flags(g.eventedit.ChanIndex)==0;
udf.chan_marks_struct(mark_ind).flags(g.eventedit.ChanIndex)=1;
%replot tick...
delete(findobj(gcf,'tag',['marker_' num2str(g.eventedit.ChanIndex)]));
plot(plot_p1, plot_p2(chan_inds(g.eventedit.ChanIndex)),'<', ...
'MarkerEdgeColor', udf.chan_marks_struct(mark_ind).tag_color, ...
'MarkerFaceColor', udf.chan_marks_struct(mark_ind).tag_color, ...
'MarkerSize', 8,'tag',['marker_' num2str(g.eventedit.ChanIndex)]);
%change line color
set(findobj(gcf,'tag',['line_' num2str(g.eventedit.ChanIndex)]), ...
'Color',udf.chan_marks_struct(mark_ind).line_color);
else
udf.chan_marks_struct(mark_ind).flags(g.eventedit.ChanIndex)=0;
non_manual_ind = find(~strcmp(g.quick_chanflag,{udf.chan_marks_struct.label}));
for mi=non_manual_ind(1):non_manual_ind(end);
if ismember(g.eventedit.ChanIndex,find(sum([udf.chan_marks_struct.flags],2)==0));
tmp_color=udf.color{:};
if strcmp(udf.plotdata2, 'on')
if length(udf.color)==2
tmp_color=udf.color{2};
else
tmp_color=[.7 .7 .7];
end
end
set(findobj(gcf,'tag',['line_' num2str(g.eventedit.ChanIndex)]), ...
'Color',tmp_color);
continue;
end
if udf.chan_marks_struct(mi).flags(g.eventedit.ChanIndex)==1;
%replot tick...
delete(findobj(gcf,'tag',['marker_' num2str(g.eventedit.ChanIndex)]));
plot(1+tag_x_int*mi,(udf.chans-(g.eventedit.ChanIndex-1))*udf.spacing,'<', ...
'MarkerEdgeColor', udf.chan_marks_struct(mi).tag_color, ...
'MarkerFaceColor', udf.chan_marks_struct(mi).tag_color, ...
'MarkerSize', 8,'tag',['marker_' num2str(g.eventedit.ChanIndex)]);
set(findobj(gcf,'tag',['line_' num2str(g.eventedit.ChanIndex)]), ...
'Color',udf.chan_marks_struct(mi).line_color);
end
end
end
end
g = rmfield(g, 'eventedit');
%set(gcbf, 'UserData', g);
set(findobj('tag', udf.tag), 'UserData',udf);
ve_eegplot('drawp',0);
%ve_eegplot('drawp',0);
return
end
else
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment