필터 지우기
필터 지우기

How to remove space between subplots of heatmaps?

조회 수: 2 (최근 30일)
meghna roy chowdhury
meghna roy chowdhury 2021년 4월 18일
답변: Bjorn Gustavsson 2021년 4월 18일
Hi, can somebody please help me with a specifc code to remove the space between the 3 subplots as shown:
The code for the above is:
%Heatmap1
subplot(3,1,1)
heata=heatmap(n2E);
heata.GridVisible='off';
colormap(jet)
heata.ColorbarVisible='off';
caxis([-0.4440 0.8660 ])
heata.FontColor='none';
%heatmap2
subplot(3,1,2)
heatp=heatmap(n2);
heatp.GridVisible='off';
colormap(jet)
heatp.ColorbarVisible='off';
caxis([0 4095])
heatp.FontColor='none';
%heatmap3
subplot(3,1,3)
heate=heatmap(n2EE);
heate.GridVisible='off';
colormap(jet)
heate.ColorbarVisible='off';
caxis([0 4095])
heate.FontColor='none';
%subplot of heatmaps
ha=get(gcf,'children');

답변 (1개)

Bjorn Gustavsson
Bjorn Gustavsson 2021년 4월 18일
If you use the axes-handle output from subplot you can then set any of their properties as you desire:
sph = subplot(3,1,1);
% plot etc
sph(2) = subplot(3,1,2);
% more plotting
sph(3) = subplot(3,1,3);
% plotting etc
set(sph(1),'position',get(sph(1),'position')+[0,-0.05 0 0.1])
% ...and so on
With newer versions of matlab you can operate on the handle-properties similar to what you do with a struct.
HTH

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by