Persistent plot legend error in recent install of R2015b

  • Context: MATLAB 
  • Thread starter Thread starter grumpymrgruff
  • Start date Start date
  • Tags Tags
    Error install Plot
Click For Summary

Discussion Overview

The discussion centers around an error encountered in MATLAB R2015b related to inserting legends in plots on a Windows 10 PC. Participants explore potential causes and solutions for the error, which arises when using the figure dropdown menu to add a legend.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant reports an error message when attempting to insert a legend, indicating issues with the AxesLayoutManager.
  • Another participant questions why resetting the path to default is not an option, suggesting that the user could restore the default path and then reapply their custom path.
  • The original poster mentions that the error occurs after adding anything to the default path and that they have checked for naming conflicts in the added directories.
  • A suggestion is made to try the command "opengl software" as a potential workaround for the issue.
  • A further recommendation is to search the MATLAB Answers forum for solutions related to the specific error message encountered.

Areas of Agreement / Disagreement

Participants express differing views on the feasibility of resetting the path to default. The original poster seems to prefer not to reset the path, while others suggest it as a viable option. The discussion remains unresolved regarding a definitive solution to the error.

Contextual Notes

The discussion highlights limitations related to the specific configurations of MATLAB installations and potential conflicts arising from custom paths. There is also uncertainty about the effectiveness of suggested commands and searches for solutions.

grumpymrgruff
Messages
16
Reaction score
2
Hey PFers. I recently did an install of Matlab R2015b on a x64 Windows 10 PC. It doesn't matter what I plot or how I plot it (e.g., plot(), scatter(),etc.), when I use the figure dropdown menu Insert→Legend I get the following error
Code:
Error using assert
Too many input arguments.

Error in matlab.graphics.shape.internal.AxesLayoutManager.getManager

Error in legendcolorbarlayout (line 19)
hManager  = matlab.graphics.shape.internal.AxesLayoutManager.getManager(hAx);

Error in matlab.graphics.illustration.Legend/setAxesImpl

Error in matlab.graphics.illustration.Legend/set.Axes_I

Error in matlab.graphics.illustration.Legend/set.Axes

Error in legend>make_legend (line 332)
leg.Axes = ha;

Error in legend (line 233)
            [h,msg] = make_legend(ha,args(arg+1:end),version);

Error in insertmenufcn (line 58)
                    leg = legend(cax,'show');
Error while evaluating Menu Callback

I've googled a bit, but there seem to be many ways to generate these errors. The only reliable fix from MATLAB support is to reset the path to default, but this isn't an option when it comes to running my code.

Has anyone experienced this and found a fix that doesn't mess with the path? Thanks!
 
Physics news on Phys.org
Why is that not an option? You can always call restoredefaultpath and then just set your custom path afterwards.
 
Image Analyst said:
Why is that not an option? You can always call restoredefaultpath and then just set your custom path afterwards.
Thanks, I tried that. It seems to happen after I add anything to the default path. I've gone through everything in the added directories to make sure there weren't any functions sharing names with MATLAB defaults.

I'm probably just going to use another PC (also x64 and same OS) that doesn't seem to have the problem. *shrugs*
 
grumpymrgruff said:
Thanks, I tried that. It seems to happen after I add anything to the default path. I've gone through everything in the added directories to make sure there weren't any functions sharing names with MATLAB defaults.

I'm probably just going to use another PC (also x64 and same OS) that doesn't seem to have the problem. *shrugs*
Try the command

Code:
opengl software

If that doesn't work, try searching the MATLAB Answers forum for various terms in your error message, for example http://www.mathworks.com/matlabcentral/answers/?term=AxesLayoutManager
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 2 ·
Replies
2
Views
8K