フィルターのクリア

Error updating Legend. Simple script throws an error/warming

1 回表示 (過去 30 日間)
Luis Erasmo Miranda
Luis Erasmo Miranda 2017 年 4 月 28 日
Hello, I'm trying modify the position and thick of the legend after was created. In this script:
clearvars
close all
clc
x=rand(1,10);
h=plot(x);
hold on
[hL,obj,outh]=legend(h,'Rand x');
set(hL,'Position',[0.3 0.8 0.06 0.05])
The last line throws this warning:
Warning: Error updating Legend.
Struct contents reference from a non-struct array object.
But, the following lines doesn't throws the warning:
hL=legend(h,'Rand x');
set(hL,'Position',[0.3 0.8 0.06 0.05])
I'm changing the propierties whit the outh handles, so I have to use the 3 outputs. Itself is not a problem, and the script does all is supposed to do. Any ideas to avoid the warning? or may be is a bug. Thank you to all.

回答 (0 件)

カテゴリ

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