MATLAB Answers

Heatmap with log scale axis

9 views (last 30 days)
Donald Ong
Donald Ong on 9 Jan 2020
Commented: David Hill on 9 Jan 2020
Hi,
I have been trying to plot a heatmap with a log scale x - axis, such as the one shown in the attachment.
I have tried to change the scale of the axis by:
set(gca, 'XScale', 'log')
But the error "The name 'XScale' is not an accessible property for an instance of class 'matlab.graphics.chart.HeatmapChart'." shows up.
Is there another way to get around this error?

  0 Comments

Sign in to comment.

Answers (2)

David Hill
David Hill on 9 Jan 2020
Look at:
semilogx()

  1 Comment

David Hill
David Hill on 9 Jan 2020
Disregard, should have looked at your file.

Sign in to comment.


Star Strider
Star Strider on 9 Jan 2020
That actually looks more like a surf plot.
Try something like this:
zdata = rand(10,50);
figure
surf(zdata)
view(0,90)
set(gca, 'XScale','log', 'Xdir','reverse')
axis('tight')
Experiment to get the result you want.

  0 Comments

Sign in to comment.

Sign in to answer this question.

Products


Release

R2019b