MATLAB Answers

How to display Heatmap plot in UI Axes of matlab app designer ?

26 views (last 30 days)
I tried using
but both options are not working and showing errors.
Please guide.
Thank You
  1 Comment
Ankit on 29 Jan 2020
Grid layout managers and scrollable containers do not support axes, polaraxes, geoaxes, or charts (such as heatmap, geobubble, or stackedplot) that can be the child of a figure
You can display it on figure not on the axes. But you want to display it on the UIaxes. I would recommend to contact MATLAB support.
cdata = [45 60 32; 43 54 76; 32 94 68; 23 95 58];
xvalues = {'Small','Medium','Large'};
yvalues = {'Green','Red','Blue','Gray'};

Sign in to comment.

Accepted Answer

Mohammad Sami
Mohammad Sami on 29 Jan 2020
Edited: Mohammad Sami on 29 Jan 2020
Place Uipanel in the position you want heatmap.
h = heatmap(app.Panel1,tbl,xvar,yvar);

Sign in to comment.

More Answers (1)

Sebastien on 5 Apr 2020
I have the same problem with the heatmap function and App Designer. So I tried the Accepted Answer but it just does not work on my side.
I added a blank panel and tried different versions of the code such as:
So I don't understand what I did wrong...
heatmap(xvar,yvar,tbl) works fine outside of the App Designer.
Thanks in advance for any help!

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by