Error bars in legend

2 ビュー (過去 30 日間)
Julian Sepulveda
Julian Sepulveda 2020 年 4 月 10 日
回答済み: Walter Roberson 2020 年 4 月 10 日
Dear Matlab comunity,
I've been using Matlab for quite a short time to create better plots for my presentations. There is however something I have not found a way to solve: how to remove the error bars from a legend. Please look at the plot below. the legend not only has the marker but also an error bar which is quite annoying. I've been reading similar questions but haven't been able to find a proper answer. Could anyone help me find a way out in a simple way ?
By the way, I'm using Matlab R2019b
Thanks!

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 4 月 10 日
Use the form of legend() that has at least two outputs. This is important, because when there are two or more outputs, legend() constructs the objects a different way.
The second output will be an array of handles to graphics objects. If you are careful about which of those you pick out, you can change the graphics objects to make the bar invisible. Do not try to delete the graphics object that forms the bar: that would mess up the way that legend cross-references its objects.

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by