필터 지우기
필터 지우기

How to make subplots from following code?

조회 수: 1 (최근 30일)
Nisar Ahmed
Nisar Ahmed 2022년 11월 17일
편집: Voss 2022년 11월 17일
Hi
I am using following way to subplot my figures but it is not working. How can I subplot my figures:
figure; subplot(121);
clf;surf(squeeze(X),squeeze(Z),squeeze(VES_base));view([0,90]);shading interp;grid on;set(gca,'YDir','reverse');colorbar
Unrecognized function or variable 'X'.
set(gca,'FontName','Times New Roman', 'fontsize', 20,'FontWeight','bold', 'linewidth', 3)
%ylim([1050 1800])
%xlim([5.55e5 5.675e5])
ylabel('Z (m)');
xlabel('X (m)');
colormap(jet)
subplot(122);
clf;surf(squeeze(X),squeeze(Z),squeeze(Pef_base));view([0,90]);shading interp;grid on;set(gca,'YDir','reverse');colorbar
set(gca,'FontName','Times New Roman', 'fontsize', 20,'FontWeight','bold', 'linewidth', 3)
%ylim([1050 1800])
%xlim([5.55e5 5.675e5])
ylabel('Z (m)');
xlabel('X (m)');
colormap(jet)
  댓글 수: 2
Image Analyst
Image Analyst 2022년 11월 17일
Well, define X for one thing.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
Nisar Ahmed
Nisar Ahmed 2022년 11월 17일
@Image Analyst Thanks, plz find the attached data.

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

채택된 답변

Voss
Voss 2022년 11월 17일
편집: Voss 2022년 11월 17일
Remove the calls to clf, which clear the figure.
load('XZP.mat')
figure; subplot(121);
surf(squeeze(X),squeeze(Z),squeeze(VES_base));view([0,90]);shading interp;grid on;set(gca,'YDir','reverse');colorbar
set(gca,'FontName','Times New Roman', 'fontsize', 20,'FontWeight','bold', 'linewidth', 3)
%ylim([1050 1800])
%xlim([5.55e5 5.675e5])
ylabel('Z (m)');
xlabel('X (m)');
colormap(jet)
subplot(122);
surf(squeeze(X),squeeze(Z),squeeze(Pef_base));view([0,90]);shading interp;grid on;set(gca,'YDir','reverse');colorbar
set(gca,'FontName','Times New Roman', 'fontsize', 20,'FontWeight','bold', 'linewidth', 3)
%ylim([1050 1800])
%xlim([5.55e5 5.675e5])
ylabel('Z (m)');
xlabel('X (m)');
colormap(jet)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by