MATLAB: How to add a legend to uiaxes in Application Designer

appdesignerlegenduiaxes

Hello, I was not able to add a legend to uiaxes in appdesigner. How do we do that? Thanks!

Best Answer

It seems like this feature was enabled in the R2016b release. Documentation from MathWorks website: Graphic support in App designer
Something in the line of this worked fine for me: legend(app.plotUIaxes, 'first_label','second_label') assuming the name of your 2D axes component is app.plotUIaxes and you want to label two curves.