Persistent plot legend error in recent install of R2015b

In summary, the error I'm getting is that I'm trying to use the legend dropdown menu in MATLAB and I'm getting an error.
  • #1
grumpymrgruff
17
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
  • #2
Why is that not an option? You can always call restoredefaultpath and then just set your custom path afterwards.
 
  • #3
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*
 
  • #4
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
 

What is a persistent plot legend error?

A persistent plot legend error refers to a problem that occurs when trying to create a legend for a plot in the R2015b version of the R programming language. It is a recurring error that has been reported by many users and can cause issues with the overall functionality of the plot.

Why does the persistent plot legend error occur in R2015b?

The exact cause of the persistent plot legend error in R2015b is not known. It could be due to a bug in the software or compatibility issues with certain operating systems or hardware configurations. However, it is a known issue and has been reported to the developers.

How can I fix the persistent plot legend error in R2015b?

Unfortunately, there is no one-size-fits-all solution for fixing the persistent plot legend error in R2015b. Some users have reported success by updating their graphics drivers or switching to a different graphics device. Others have found success by reinstalling the software or downgrading to a previous version. It may require some trial and error to find a solution that works for your particular setup.

Is there a workaround for the persistent plot legend error in R2015b?

There are a few workarounds that have been suggested by other users who have experienced the persistent plot legend error in R2015b. These include manually creating the legend using the "legend" function or using a different plotting package such as "ggplot2". However, these workarounds may not work for all users and may require some additional knowledge of R programming.

Has the persistent plot legend error been fixed in newer versions of R?

Yes, the persistent plot legend error has been addressed in newer versions of R. If possible, it is recommended to upgrade to the latest version to avoid encountering this error. However, if you are unable to upgrade, you may need to explore other solutions or workarounds to resolve the issue.

Back
Top