필터 지우기
필터 지우기

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 CenterFile Exchange에서 Legend에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by