I made a Heat map. I want to remove the x and y axis ticks. How is that possible?
62 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sattik Basu
el 8 de Sept. de 2017
Comentada: Walter Roberson
el 23 de Ag. de 2024 a las 18:55
I tried using set(gca............), but that is for plot. i am stuck at this.
2 comentarios
Walter Roberson
el 8 de Sept. de 2017
Is this the heatmap from the Bioinformations toolbox? https://www.mathworks.com/help/bioinfo/ref/heatmap.html
Respuestas (3)
Walter Roberson
el 9 de Sept. de 2017
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 comentarios
Jesús Bernardino Velázquez Fernández
el 22 de Ag. de 2023
Editada: Walter Roberson
el 22 de Ag. de 2023
h=heatmap(x,y,c);
s=struct(h);
s.XAxis.Visible='off';
s.YAxis.Visible='off';
6 comentarios
Din
el 23 de Ag. de 2024 a las 4:08
Thank you for your reply. But actually my question was to
(i) remove the [Excellent, Fair, Good, Poor] and [false, true],
(ii) replace them with markings which have different dimensions (my data has [1:51] and [1:6]. I want to replace them with [90, 80, 70, ...,20, 10, 0] and [1,2,4,8,16,32]).
(iii) keep "dogs" and "cats".
Walter Roberson
el 23 de Ag. de 2024 a las 18:55
load patients
tbl = table(LastName,Age,Gender,SelfAssessedHealthStatus,...
Smoker,Weight,Location);
h = heatmap(tbl,'Smoker','SelfAssessedHealthStatus');
h.XLabel = 'cats';
h.YLabel = 'dogs';
%using struct in this way will produce warnings so we disable the warning
old_warning_state = warning('off', 'MATLAB:structOnObject');
hs = struct(h);
warning(old_warning_state);
hs.Axes.XTickLabels = cellstr(string([1 2])).';
hs.Axes.YTickLabels = cellstr(string([90 80 70 60])).';
Ver también
Categorías
Más información sobre Data Distribution Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!