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!