Color change in plots

2 Ansichten (letzte 30 Tage)
Camilla
Camilla am 3 Jun. 2024
Beantwortet: Matlab Pro am 3 Jun. 2024
Hello Y'all,
I have a figure in which two curves are shown. The Problem is that both curves overlap so its hard to properly see both curves. Im trying to make the colors more transparent so that you can clearly see both curves despite the overlap.
I attached the Figure below.
Thank u in advance
% Plot for CS+ und CS-
figure;
shadedErrorBar(time_vector, mean_curve2_all_CS_plus, se_CS_plus, {'-r', 'LineWidth', 2});
hold on;
shadedErrorBar(time_vector, mean_curve2_all_CS_minus, se_CS_minus, {'-b', 'LineWidth', 2});
hold off;
xlabel('Zeit');
ylabel('Mittelwert');
title('Durchschnittliche Mittelwerte für CS+ und CS-');
legend('CS+', 'CS-');
  1 Kommentar
Image Analyst
Image Analyst am 3 Jun. 2024
Make it easy for us to answer you. Please insert a screenshot into your message, or at least a PNG file so we can view it here without downloading it and going to MATLAB to open it up (less convenient).

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Matlab Pro
Matlab Pro am 3 Jun. 2024
Hi
I have seen your attached fig (better to attach (also) a *.png file as @Image Analyst commented
Anyhow - you use "shadedErrorBar" function (Xchange server link: https://www.mathworks.com/matlabcentral/fileexchange/26311-raacampbell-shadederrorbar
)
If you are looking @ the "demo_shadedErrorBar_live.mlx" file - line 36 is:
shadedErrorBar(x, y, {@mean,@std}, 'lineprops', '-r','transparent',false,'patchSaturation',0.075)
You can control tranparancy by setting: 'transparent' to 'true' and tune the 'patchSaturation' to the desired tranparant requested
Explicitly:
change to:
shadedErrorBar(x, y, {@mean,@std}, 'lineprops', '-r','transparent',true,'patchSaturation',0.075)
and view the result (red line)
Before
Before
After
After
Good luck

Kategorien

Mehr zu Lighting, Transparency, and Shading finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by