MATLAB Answers

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

25 views (last 30 days)
I tried using
heatmap(app.UIFigure.UIAxes,A,XValue_Text,X2Value_Text)
heatmap(app.UIFigure,app.UIAxes,A,XValue_Text,X2Value_Text)
but both options are not working and showing errors.
Please guide.
Thank You

  1 Comment

Ankit
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'};
heatmap(app.UIFigure,xvalues,yvalues,cdata)

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);

  3 Comments

Rohit Deshmukh
Rohit Deshmukh on 30 Jan 2020
Hello Sami,
Thanks a lot for answer!
It's not showing any errors now.
But Unfortunately, the UI axes are blank and cannot see Heat map over there.
Mohammad Sami
Mohammad Sami on 30 Jan 2020
Can you try this in console
f = uifigure;
g = uigridlayout(f,[1 1]);
p = uipanel(g);
p.Layout.Row = 1;
p.Layout.Column = 1;
heatmap(p,rand(10,10));
Rohit Deshmukh
Rohit Deshmukh on 30 Jan 2020
Hi,
the previous solution is working with a different panel.
I figured out that UI axes is superimposing the HeatMap plot.
I tried to disable the UI axes , but still the blank thing is superimposing Heatmap.
Is there a solution by which I somehow delete/disappear the UI Axes when HeatMap plot is selected?

Sign in to comment.

More Answers (0)

Sign in to answer this question.