代码如下:
clc;
close all;
Fontsize = 10.5;
LineWidth = 1.5;
TickLength = [0.01,0.035];
GridColor = [0.85,0.85,0.85]; %[0.85,0.85,0.85];
FANWEI = [1,5,0,90]; %坐标范围
f1 = figure(1);
f1.Visible = 'on';
f1.Units = 'centimeters';
f1.Position = [15 5 21 10];
f1.Color = 'w';
f1.NumberTitle = 'off';
f1.Name = 'name';
f1.Resize = 'off';
ax1 = axes(f1);
ax1.Box = 'off';
ax1.Units = 'normalized';
ax1.Position = [0.06 0.15 0.86/3 0.8];
ax1.PositionConstraint = 'innerposition';
ax1.Visible = 'on';
ax1.NextPlot = 'add';
ax1.Color= 'w';
ax1.TickDir = 'in';
ax1.FontUnits = 'points';
ax1.FontSize = Fontsize;
ax1.LineWidth = LineWidth;
ax1.FontName = 'Times New Roman';
ax1.FontWeight = 'bold';
ax1.TitleFontSizeMultiplier = 1;
ax1.LabelFontSizeMultiplier = 1;
ax1.XColor = 'k';
ax1.YColor = 'k';
ax1.YAxisLocation = 'left';
ax1.XAxisLocation = 'origin';
ax1.TickLength = TickLength;
ax1.XDir = 'normal';
ax1.YDir = 'normal';
grid(ax1,'on');
ax1.GridLineStyle = '--';
ax1.GridAlpha = 0.85;
ax1.GridColor = GridColor;
ax2 = axes(f1);
ax2.Box = 'off';
ax2.Units = 'normalized';
ax2.Position = [0.09+0.86/3 0.15 0.86/3 0.8];
ax2.PositionConstraint = 'innerposition';
ax2.Visible = 'on';
ax2.NextPlot = 'add';
ax2.Color= 'w';
ax2.TickDir = 'in';
ax2.FontUnits = 'points';
ax2.FontSize = Fontsize;
ax2.LineWidth = LineWidth;
ax2.FontName = 'Times New Roman';
ax2.FontWeight = 'bold';
ax2.TitleFontSizeMultiplier = 1;
ax2.LabelFontSizeMultiplier = 1;
ax2.XColor = 'k';
ax2.YColor = 'none';
ax2.YAxisLocation = 'left';
ax2.XAxisLocation = 'origin';
ax2.TickLength = TickLength;
ax2.XDir = 'normal';
ax2.YDir = 'normal';
grid(ax2,'on');
ax2.GridLineStyle = '--';
ax2.GridAlpha = 0.85;
ax2.GridColor = GridColor;
ax3 = axes(f1);
ax3.Box = 'off';
ax3.Units = 'normalized';
ax3.Position = [0.12+0.86/3*2 0.15 0.86/3 0.8];
ax3.PositionConstraint = 'innerposition';
ax3.Visible = 'on';
ax3.NextPlot = 'add';
ax3.Color= 'w';
ax3.TickDir = 'in';
ax3.FontUnits = 'points';
ax3.FontSize = Fontsize;
ax3.LineWidth = LineWidth;
ax3.FontName = 'Times New Roman';
ax3.FontWeight = 'bold';
ax3.TitleFontSizeMultiplier = 1;
ax3.LabelFontSizeMultiplier = 1;
ax3.XColor = 'k';
ax3.YColor = 'none';
ax3.YAxisLocation = 'left';
ax3.XAxisLocation = 'origin';
ax3.TickLength = TickLength;
ax3.XDir = 'normal';
ax3.YDir = 'normal';
grid(ax3,'on');
ax3.GridLineStyle = '--';
ax3.GridAlpha = 0.85;
ax3.GridColor = GridColor;
%p1 = plot(ax1,x,y); %在第一个坐标画图
%p1 = plot(ax2,x,y); %在第二个坐标画图
%p1 = plot(ax3,x,y); %在第三个坐标画图
结果:
?
|