Filter löschen
Filter löschen

Error updating Legend. Simple script throws an error/warming

1 Ansicht (letzte 30 Tage)
Luis Erasmo Miranda
Luis Erasmo Miranda am 28 Apr. 2017
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.

Antworten (0)

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by