Why am I getting an error when using legend command
古いコメントを表示
After installing R2014a, I have a consistent problem with functions and scripts that have worked in the past, specifically with the "legend" function. As an example, I wrote a simple script:
t = 0:.1:100;
x = [0:.1:100];
plot(t,x)
legend('y');
It produces the following error:
Error using flip
Too many input arguments.
Error in flipud (line 14)
x = flip(x,1);
Error in get_legendable_children (line 61)
ch = flipud(legkids(goodkid));
Error in graph2dhelper (line 31)
[varargout{1:nargout}] = feval(varargin{:});
Error in legend>make_legend (line 350)
children = graph2dhelper ('get_legendable_children', ha);
Error in legend (line 284)
[h,msg] = make_legend(ha,varargin(arg:end));
Error in Test (line 6)
legend('y');
5 件のコメント
Star Strider
2014 年 6 月 27 日
I can’t reproduce your error (R2014a). It works fine for me. You may want to Contact Support.
dpb
2014 年 6 月 27 日
That clearly is just a bug.
Geoff Hayes
2014 年 6 月 27 日
The error being raised here is identical to that from profiler error with flip. The problem there was that there existed a custom flip function that was interfering with the MATLAB built-in one.
In the Command Window, type
which flip -all
and check the results. If a custom version of flip does exist, it will appear in this list (and so need to be renamed).
dpb
2014 年 6 月 27 日
Ewww...Matlab namespace pollution strikes again! Soon there won't be any names left to use as TMW continues to introduce new stuff...
>> which flip
'flip' not found.
>>
Star Strider
2014 年 6 月 27 日
In R2014a:
which flip -all
produces:
built-in (C:\Program Files\MATLAB\R2014a\toolbox\matlab\elmat\flip)
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Legend についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!