How do I make stairs lines transparent?
7 views (last 30 days)
Show older comments
Hi all, I'm new to matlab and would be grateful for your help. I have two columns of data "m_53_rp100_rcp45" and "m_55_rp100". I have the code below to draw stairs lines. It gives the figure attached. I would like to make the red lines transparent so we can see the overlaps and black lines underneath.

figure
stairs(m_53_rp100_rcp45,':');
hold on
s = stairs(m_55_rp100,'r');
hold off
0 Comments
Answers (2)
Walter Roberson
on 10 May 2017
There is no transparency setting for stair objects (or for line plots in general.) If you are using R2014b or later (as is very likely since you are new to MATLAB) then in order to get transparency you would have to create patch objects that look like lines; see https://www.mathworks.com/matlabcentral/answers/103074-how-can-i-set-the-transparency-of-line-objects-in-matlab-7-14-r2012a
2 Comments
Walter Roberson
on 10 May 2017
stairs plots have to draw with x y in the form
[x1 x2 x2 x3 x3 x4 x4 ...],
[y1 y1 y2 y2 y3 y3 y4 ...]
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!