... | ... | @@ -123,7 +123,7 @@ For Example: |
|
|
This pattern matches for most of the marks.
|
|
|
|
|
|
**Pie Chart Example**
|
|
|
Below is the code for the pie chart separating the channel types.
|
|
|
Below is the code for the pie chart separating the channel types. This code exclusively uses the marks structure for its data.
|
|
|
```matlab
|
|
|
% Pie Chart
|
|
|
c1 = length(EEG.marks.chan_info(1).flags); % Collect Number of Epochs
|
... | ... | @@ -138,12 +138,51 @@ explode = [1 0 0 0]; |
|
|
ax1 = subplot(1,2,1); %Set up input - Make the pie chart the first plot of a of a 1x2 subplot grid
|
|
|
labels = {'Remaining Channels','Comically Bad','Low Correlation','Bridged'}; %Set up input - Create cell array of labels corresponding to c values
|
|
|
pie(ax1,cpie,explode,labels); % Plot pie graph using parameters just created.
|
|
|
colormap(jet); % Set the color scheme to *jet*
|
|
|
colormap(jet); % Set the color scheme to be jet
|
|
|
title('Data Channel Classification'); % Set the title of the chart
|
|
|
|
|
|
```
|
|
|
|
|
|
**Calculation->Flag->Mark/Criteria Plot Example**
|
|
|
Below is the code for the s way subplot of calculating channel marks. This code exclusively uses the EEG. calculation matrices for its data.
|
|
|
```matlab
|
|
|
% Collect Data
|
|
|
z = EEG.data_sd_ch; % Finding the calculated values of the standard deviations
|
|
|
z(z>100) = 100; % Cap on the max deviation value, nice to show a better color gradient on the image. Just for looks.
|
|
|
|
|
|
figure; % Generate a figure window - nothing plotted yet
|
|
|
|
|
|
% Surface Plot 1
|
|
|
ax1 = subplot(1,3,1); % Select the subplot location for the upcoming plot to be space 1 in the 1x3.
|
|
|
surf(ax1,z,'LineStyle','none','FaceAlpha',0.9); % Plot the surface wave without grid lines and a 90% opacity.
|
|
|
view(0,90); % Rotate the surface plot so that it is 2D birds eye view
|
|
|
title('Standard Deviations'); %Add a title
|
|
|
xlabel('Epoch Number'); %Add a y- axis label
|
|
|
ylabel('Channel Number'); %Add a x- axis label
|
|
|
axis([0 size(z,2) 0 size(z,1)]); %Trim the image axis so that it is plotted as a tight fit. (xmin xmax ymin ymax)
|
|
|
colormap(jet); %Set the color scheme to be jet
|
|
|
|
|
|
% Surface Plot 2 - Compact version similar to Surface plot 1
|
|
|
ax2 = subplot(1,3,2); % Subplot location is 2 in the 1x3
|
|
|
surf(ax2,EEG.c_data_sd_ch,'LineStyle','none','FaceAlpha',0.9);view(0,90); % Data plotted this time is the flags EEG.c_data_sd_ch
|
|
|
title('Flags'); colormap(jet); axis([0 size(z1,2) 0 size(z1,1)]);
|
|
|
xlabel('Epoch Number'); ylabel('Channel Number');
|
|
|
|
|
|
% Critical Value Data
|
|
|
x = mean(EEG.c_data_sd_ch,2); % Row vector, Average of flags along each channel
|
|
|
y = 1:size(EEG.c_data_sd_ch,1); % Row vector, Channels numbers
|
|
|
x(:,2) = 0.1; % Second row vector in variable x, vertical line with equation x = 0.1
|
|
|
ax3 = subplot(1,3,3); % Subplot location
|
|
|
plot(ax3,x,y); % Plot of the x and y vectors to make a graph
|
|
|
title('Mean of Marks Critical Value'); % Standard plotting labels
|
|
|
xlabel('% Of Channel Flagged');
|
|
|
ylabel('Channel Number');
|
|
|
axis([-0.05 1 0 (length(x + 1))]); % Axis trimming (xmin xmax ymin ymax)
|
|
|
````
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
... | ... | |