Color change in plots
2 ビュー (過去 30 日間)
古いコメントを表示
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
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
2024 年 6 月 3 日
Hi
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
After
Good luck
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Lighting, Transparency, and Shading についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!