new file: lab3/createfigure.m
new file: lab3/untitled.jpg
This commit is contained in:
49
lab3/createfigure.m
Normal file
49
lab3/createfigure.m
Normal 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
BIN
lab3/untitled.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
Reference in New Issue
Block a user