Color change in plots

2 ビュー (過去 30 日間)
Camilla
Camilla 2024 年 6 月 3 日
回答済み: Matlab Pro 2024 年 6 月 3 日
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 件のコメント
Image Analyst
Image Analyst 2024 年 6 月 3 日
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).

サインインしてコメントする。

回答 (1 件)

Matlab Pro
Matlab Pro 2024 年 6 月 3 日
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

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by