文章目录
43. 绘图对象
fig1 = figure(1);
% fig1 =
% Figure (1) - 属性:
% Number: 1
% Name: ''
% Color: [0.9400 0.9400 0.9400]
% Position: [488 342 560 420] % 横坐标起始点,纵坐标起始点,横坐标像素,纵坐标像素
% Units: 'pixels'
fig1.Color; % rgb 0.9400 0.9400 0.9400
fig1.Color = [1 0 0]; % 修改颜色
line1 = plot(rand(1,10));
% line1 =
% Line - 属性:
% Color: [0 0.4470 0.7410]
% LineStyle: '-'
% LineWidth: 0.5000
% Marker: 'none'
% MarkerSize: 6
% MarkerFaceColor: 'none'
% XData: [1 2 3 4 5 6 7 8 9 10]
% YData: [1×10 double]
% ZData: [1×0 double]
%
% 显示 所有属性
line1.LineStyple = '--';
fig2 = figure(2);
fig2.Color = [0 1 0];
line2 = plot(rand(1,10));
ax1 = fig1.Children;
% ax1 =
% Axes - 属性: (坐标系)
% XLim: [1 10]
% YLim: [0 1]
% XScale: 'linear'
% YScale: 'linear'
% GridLineStyle: '-'
% Position: [0.1300 0.1100 0.7750 0.8150] %坐标系在画布中的位置,左下角x和y,右上角x,y
% Units: 'normalized'
%
% 显示 所有属性
line1 = ax1.Children;
line1.Parent; % ax1
ax1.Parent; % fig1
fig1.Parent;
% ans =
% Graphics Root - 属性: (显示器)
% CurrentFigure: [1×1 Figure]
% ScreenPixelsPerInch: 96
%