EEG signal plot varies if all channel data is plotted separately...
3 views (last 30 days)
Show older comments
I have plot my EEG data with the code given below:
x=load('02SegmentedData.mat');
LC=length(x)
fs=125
TC=[0:LC-1]/fs
%Plotting
figure;subplot (211),plot(TC,x)
xlabel('Time (s)'), ylabel('Amplitude (uV)'), title('Complete EEG data')
hold on;
I got the plot with the code given ablove but it is different from the plot which i got after plotting each channel data seperatley with the code given below:
for k=1:16
subplot(4,4,k),plot(TC,x(:,k))
xlabel('Time (s)'), ylabel('Amplitude (uV)'), title(sprintf('EEG signal of %d channel',k))
hold on;
end
Any help will be highly appreciated.Why i am getting diffenerent amplitude value in these two graph
0 Comments
Answers (1)
Aastha
on 9 Jun 2025
I understand that you are observing a discrepancy between the EEG plots generated using the two different code snippets: one where all channels are plotted together and another where each channel is plotted separately.
This difference in appearance is primarily due to axis scaling, not due to any change in the actual amplitude values caused by the "plot" function.
When you use the MATLAB code mentioned below:
figure; subplot(211), plot(TC, x)
all 16 EEG channels are overlaid on the same subplot. As a result, the y-axis automatically scales to encompass the full range of values across all channels, from the minimum amplitude (e.g. -6 µV from channel 1) to the maximum amplitude (e.g. 6 µV from channel 10). This broader range can make individual variations look smaller and compressed.
When you plot each channel separately using the MATLAB code snippet mentioned below:
for k = 1:16
subplot(4,4,k), plot(TC, x(:,k))
xlabel('Time (s)'), ylabel('Amplitude (uV)'), title(sprintf('EEG signal of %d channel', k))
hold on;
end
Each subplot is independently scaled based on the amplitude range of that specific channel. This allows each plot to show more detail and variation within its own amplitude range, making the signals appear more distinct.
So, the perceived differences between the two plots are purely visual due to the automatic scaling behaviour of MATLAB subplots; There is no alteration in the underlying EEG data or amplitude values.
For more information on the "plot" and "subplot" functions, you may refer to the following MathWorks documentation:
I hope this is helpful!
0 Comments
See Also
Categories
Find more on EEG/MEG/ECoG in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!