필터 지우기
필터 지우기

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
Image Analyst
Image Analyst 2017년 9월 10일
Imshow has an 'InitialMagnification' setting.
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;
  댓글 수: 1
Sattik Basu
Sattik Basu 2017년 9월 8일
i tried this too. but i am getting the following error.
Error using axis (line 63) Using axis with heatmap is not supported.

댓글을 달려면 로그인하십시오.


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';
Walter Roberson
Walter Roberson 2023년 8월 22일
편집: Walter Roberson 2023년 8월 22일
Note this removes the x and y axes labels as well as the ticks.

댓글을 달려면 로그인하십시오.

카테고리

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