I made a Heat map. I want to remove the x and y axis ticks. How is that possible?

28 次查看(过去 30 天)
I tried using set(gca............), but that is for plot. i am stuck at this.

回答(3 个)

Walter Roberson
Walter Roberson 2017-9-9
There are no x and y axis ticks for the new R2017a heatmap object. There is at most the ticks inside the colorbar beside the drawing. Is it the colorbar tick marks that you want to remove?
  10 个评论
FWDekker
FWDekker 2020-4-10
编辑:FWDekker 2020-4-10
Thanks, Walter! Just a quick note: Calling xlabel or ylabel after doing this may bring back the ticks. Took me a while to figure out why your snippet didn't seem to be working.

请先登录,再进行评论。


Image Analyst
Image Analyst 2017-9-8
How about
axis off;

Jesús Bernardino Velázquez Fernández
编辑:Walter Roberson 2023-8-22
h=heatmap(x,y,c);
s=struct(h);
s.XAxis.Visible='off';
s.YAxis.Visible='off';
  2 个评论
Walter Roberson
Walter Roberson 2023-8-22
Demonstration:
load patients
tbl = table(LastName,Age,Gender,SelfAssessedHealthStatus,...
Smoker,Weight,Location);
h = heatmap(tbl,'Smoker','SelfAssessedHealthStatus');
s=struct(h);
Warning: Calling STRUCT on an object prevents the object from hiding its implementation details and should thus be avoided. Use DISP or DISPLAY to see the visible public details of an object. See 'help struct' for more information.
s.XAxis.Visible='off';
s.YAxis.Visible='off';

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Colormaps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by