setting transparancy of legend?
古いコメントを表示
Is it possible to make the background of the legend be slighly transparent so that the lines behind it can be somewat visible?
1 件のコメント
Walter Roberson
2017 年 1 月 16 日
I will not say that it is impossible at the moment. It is certainly not documented. You just might be able to change it using one of the hidden properties of the legend. Perhaps one of the ColorSpace properties. Nothing I have tried has worked yet.
採用された回答
その他の回答 (3 件)
alice
2017 年 6 月 27 日
4 投票
In undocumented Matlab, you will find how to do it here: http://undocumentedmatlab.com/blog/transparent-legend.
3 件のコメント
Walter Roberson
2019 年 12 月 17 日
Miquel
2020 年 1 月 31 日
Awesome, guys! Thanks :)
Hakon Haugnes
2023 年 8 月 17 日
echo that: awesom
Ilja Maljutenko
2021 年 5 月 19 日
This solution seems to work in Matlab 2020 +
h_leg.BoxFace.ColorType='truecoloralpha';
h_leg.BoxFace.ColorData=uint8(255*[1 1 1 0.75]');
where h_leg is your legend box handle.
Wilson A N
2017 年 1 月 16 日
編集済み: Walter Roberson
2017 年 1 月 16 日
0 投票
You can refer to the link given below on how to set the different properties of legend
To change the background color of the legend you can change the 'Color' field to achieve the required transparency.
3 件のコメント
Walter Roberson
2017 年 1 月 16 日
編集済み: Walter Roberson
2017 年 1 月 16 日
Unfortunately changing the Color property does not allow you to set transparency: it is still going to completely hide any line underneath.
There are some parts of HG2 which have quietly introduced allowing a quad to be specified instead of a color triple in order to put in transparency, but unfortunately legends do not have that as yet.
James Richard
2019 年 12 月 17 日
Any news on this?
Walter Roberson
2019 年 12 月 17 日
カテゴリ
ヘルプ センター および File Exchange で Legend についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
