pop_ploterps plot waves in accordance to a color scheme

1 Ansicht (letzte 30 Tage)
Maemi Jane
Maemi Jane am 17 Jan. 2024
Bearbeitet: Gojo am 22 Jan. 2024
I am trying to avoid the cycling of colors in pop_ploterps (in bold). I want my plot waves to follow a uniform color scheme like parula, I tried replacing it with the rgb and hex format but linespec only accepts strings. Is there any way that I could do this?
ERP = pop_ploterps( ERP, 1:50, [1:64] , 'AutoYlim', 'on', 'Axsize', [ 0.05 0.08], 'BinNum', 'on', 'Blc', 'pre', 'Box',...
[ 3 4], 'ChLabel', 'on', 'FontSizeChan', 10, 'FontSizeLeg', 12, 'FontSizeTicks', 10, 'LegPos', 'none', 'Linespec', {'k-' , 'r-' , 'b-' ,...
'g-' , 'c-' , 'm-' , 'y-' , 'w-' , 'k-' , 'r-' , 'b-' , 'g-' , 'c-' , 'm-' , 'y-' , 'w-' , 'k-' , 'r-' , 'b-' , 'g-' , 'c-' , 'm-' , 'y-' ,...
'w-' , 'k-' , 'r-' , 'b-' , 'g-' , 'c-' , 'm-' , 'y-' , 'w-' , 'k-' , 'r-' , 'b-' , 'g-' , 'c-' , 'm-' , 'y-' , 'w-' , 'k-' , 'r-' , 'b-' ,...
'g-' , 'c-' , 'm-' , 'y-' , 'w-' , 'k-' , 'r-' }, 'LineWidth', 0.3, 'Maximize', 'on', 'Position', [ 24.5 11.5 106.875 31.9444], 'Style',...
'Classic', 'Tag', 'ERP_figure', 'Transparency', 0, 'xscale', [ -100.0 4999.0 -50 0:800:4000 ], 'YDir', 'normal' );
Thank you!

Antworten (1)

Gojo
Gojo am 22 Jan. 2024
Bearbeitet: Gojo am 22 Jan. 2024
Hey Maemi Jane,
Although I don't have access to the EEGLAB toolbox, I can offer some ideas on how waves might be plotted using a color gradient.
You can alter the 'ColorOrder' axes-property to plot multiple waves in accordance with a color scheme. For instance, check out the following example:
You can apply a color gradient within the same wave using the "surface" or "patch" functions. Have a look at the following MATLAB Answer case:
You can plot your desired dataset using either function as mentioned. You can use colormaps like "Parula". Refer to the following code snippet:
x = linspace(0, 2*pi, 100);
y = cos(x);
patch([x nan],[y nan],[y nan],[x nan], 'edgecolor', 'interp');
colorbar;
colormap(parula);
Additionally, you can make changes to an existing line plot and add gradient to it. Refer to the following code snippet:
n=100;
x = linspace(0, 2*pi, n);
y = cos(x);
plot_handle = plot(x,y,'r');
cd = [uint8(parula(n)*255) uint8(ones(n,1))].';
drawnow;
set(plot_handle.Edge, 'ColorBinding','interpolated', 'ColorData',cd);
I hope this helps.

Kategorien

Mehr zu Graphics Performance finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by