Stacking one subplot on top of other.
조회 수: 1 (최근 30일)
이전 댓글 표시
I am trying to stack one subplot on the top of other. The problem is that I couldn't put whole figure in a box. Also I want the figure only to show the tick marks at specified points only. In y scale I want it to show the scale in 10, 100 and 1000 rather than power of 10.
a=subplot(2,1,2);
surf(A(2:end,1)',A(1,2:end)',A(2:end,2:end)','edgecolor','none');
view(2);
xlim([350 450]);
set(gca,'XTick',[350 370 390 410 430 450]);
ylim([-1 1]);
yticks([-1 0 1]);
caxis([-0.02 0.01]);
set(gca,'TickDir','out'); % The only other option is 'in'
colorbar;
set(colorbar,'Position',[ 0.66 0.2 0.03 0.6]);% set the position and size of colorbar as width and height
b=subplot(2,1,1);
surf(A(2:end,1)',A(1,2:end)',A(2:end,2:end)','edgecolor','none');
view(2);
set(gca,'yscale','log');
xlim([350 450]);
ylim([1 3000]);
b.XAxis.Visible='off';
caxis([-0.02 0.01]);
grid off; % removes line between two subplots
set(gca,'XTick',[]);
%set(gca,'TickDir','out'); % The only other option is 'in'
yticks([ 10 100 1000]);
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Subplots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!