Customise Colours in stackedplot
古いコメントを表示
I have this figure here, and I need to change the line style of the 2 horizontal images in (b) online. The command :
s.LineProperties(2).Color = 'r'
changes all 3 lines, and I am not sure how to change only a single one.
Thanks!

2 件のコメント
KALYAN ACHARJYA
2021 年 5 月 30 日
Please share the code for quick fix, if possible
Hugo Fortescue
2021 年 5 月 30 日
採用された回答
その他の回答 (2 件)
Hugo Fortescue
2021 年 6 月 2 日
編集済み: Hugo Fortescue
2021 年 6 月 2 日
1 件のコメント
> I was not able to get the desried results with stackedplot
I just noticed that your 2nd axes has 3 lines - they are difficult to see in the embedded image in your question. I've updated my answer to show how to set the color of a single line in stackedaxes that contains multiple lines per axes.
Lianne Wolsink
2022 年 12 月 16 日
Using stackedplot, the color of one line within an axis containing multiple lines can be changed using this code:
a = stackedplot(table,vars);
a.LineProperties(2).Color = [0 0 0
1 0 0]; % changes colors of lines in axis 2 to black for line 1 and red for line 2
カテゴリ
ヘルプ センター および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

