MATLAB Answers

Plots in app designer

5 views (last 30 days)
Dears ,
Have question regrading ploting in app designer ,
I have the following code for ploting a figure
figure(1);
barh(predictorImportance)
grid on
set(gca,'ytickLabel',inputNames(sortedIndex))
xlabel({'Predictor Importance for ', convertCharsToStrings(outputNames) })
........................................
How can do code change so that it fit to app. uiaxes , in other words , how I can use app. uiaxes to make the same plot .

  0 Comments

Sign in to comment.

Accepted Answer

Mohammad Sami
Mohammad Sami on 18 May 2020
You can specify the handle of the uiaxes, so that matlab knows which axes to plot on.
barh(app.UIAxes,predictorImportance);
grid(app.UIAxes,'on');
set(app.UIAxes,'ytickLabel',inputNames(sortedIndex));
xlabel(app.UIAxes,{'Predictor Importance for ', convertCharsToStrings(outputNames) });

  1 Comment

Asad Elmgerbi
Asad Elmgerbi on 18 May 2020
Thanks Mohammad .
It works

Sign in to comment.

More Answers (0)