new file: lab3/createfigure.m

new file:   lab3/untitled.jpg
This commit is contained in:
2025-11-20 20:29:08 +08:00
parent 1b3b07a7f6
commit 55b82a23bc
2 changed files with 49 additions and 0 deletions

49
lab3/createfigure.m Normal file
View File

@@ -0,0 +1,49 @@
function createfigure(X1, Y1, xdata1, ydata1, zdata1)
%CREATEFIGURE(X1, Y1, xdata1, ydata1, zdata1)
% X1: plot x
% Y1: plot y
% XDATA1: surface xdata
% YDATA1: surface ydata
% ZDATA1: surface zdata
% MATLAB 17-Nov-2025 11:39:30
% figure
figure1 = figure('PaperSize',[20.99999864 29.69999902]);
% axes
axes1 = axes('Parent',figure1,...
'Position',[0.570340909090909 0.0936507936507937 0.318944805194805 0.831349206349211]);
hold(axes1,'on');
% plot
plot(X1,Y1,'DisplayName','data1','Parent',axes1);
% X
% xlim(axes1,[-1.37272865846885 1.35932516299143]);
% Y
% ylim(axes1,[0.35208977067959 1.03510322604466]);
box(axes1,'on');
hold(axes1,'off');
% legend
legend1 = legend(axes1,'show');
set(legend1,...
'Position',[0.666574619538538 0.424688172043011 0.139880952380952 0.0428571428571429]);
% colorbar
colorbar(axes1);
% axes
axes2 = axes('Parent',figure1,...
'Position',[0.065714222135995 0.11 0.393012722609596 0.625290174459612]);
hold(axes2,'on');
% surf
surf(xdata1,ydata1,zdata1,'Parent',axes2);
% title
title({'-'});
view(axes2,[-37.5 30]);
grid(axes2,'on');
hold(axes2,'off');

BIN
lab3/untitled.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB