t=0:0.1:2*pi; x=3*cos(t); y=sin(t); subplot(2,2,1);plot(x,y);axis normal subplot(2,2,2);plot(x,y);axis square subplot(2,2,3);plot(x,y);axis equal subplot(2,2,4);plot(x,y);axis equal tight
t=0:0.1:2*pi; x=3*cos(t); y=sin(t); subplot(2,2,1);plot(x,y);axis normal subplot(2,2,2);plot(x,y);axis square subplot(2,2,3);plot(x,y);axis equal subplot(2,2,4);plot(x,y);axis equal tight axis off axis on box off box on grid on grid off
saveas(gcf,'<filename>','<formattype>') printf
x=linspace(0,2*pi,1000); y=sin(x); plot(x,y); h=plot(x,y); get(h)
在命令行窗口执行这条指令,因为有了get,也就是说获得属性,那么窗口中会的自动给出所有属性
x=linspace(0,2*pi,1000); y=sin(x); plot(x,y); h=plot(x,y); get(h) AlignVertexCenters: 'off' Annotation: [1×1 matlab.graphics.eventdata.Annotation] BeingDeleted: 'off' BusyAction: 'queue' ButtonDownFcn: '' Children: [0×0 GraphicsPlaceholder] Clipping: 'on' Color: [0 0.4470 0.7410] CreateFcn: '' DeleteFcn: '' DisplayName: '' HandleVisibility: 'on' HitTest: 'on' Interruptible: 'on' LineJoin: 'round' LineStyle: '-' LineWidth: 0.5000 Marker: 'none' MarkerEdgeColor: 'auto' MarkerFaceColor: 'none' MarkerIndices: [1×1000 uint64] MarkerSize: 6 Parent: [1×1 Axes] PickableParts: 'visible' Selected: 'off' SelectionHighlight: 'on' Tag: '' Type: 'line' UIContextMenu: [0×0 GraphicsPlaceholder] UserData: [] Visible: 'on' XData: [1×1000 double] XDataMode: 'manual' XDataSource: '' YData: [1×1000 double] YDataSource: '' ZData: [1×0 double] ZDataSource: ''
②修改属性:modify properties用set()
x=linspace(0,2*pi,1000); y=sin(x); plot(x,y); h=plot(x,y); set(gca,'XLim',[0,2*pi]); set(gca,'YLim',[-1.2,1.2]);
x=linspace(0,2*pi,1000); y=sin(x); plot(x,y); h=plot(x,y); set(gca,'XLim',[0,2*pi]); set(gca,'YLim',[-1.2,1.2]); set(gca,'FontSize',25);
x=linspace(0,2*pi,1000); y=sin(x); plot(x,y); h=plot(x,y); set(gca,'XLim',[0,2*pi]); set(gca,'YLim',[-1.2,1.2]); set(gca,'FontSize',25); set(gca,'XTick',0:pi/2:2*pi);
x=linspace(0,2*pi,1000); y=sin(x); plot(x,y); h=plot(x,y); set(gca,'XLim',[0,2*pi]); set(gca,'YLim',[-1.2,1.2]); set(gca,'FontSize',25); set(gca,'XTick',0:pi/2:2*pi); set(gca,'XTickLabel',0:90:360);
>> x=linspace(0,2*pi,1000); y=sin(x); plot(x,y); h=plot(x,y); set(gca,'XLim',[0,2*pi]); set(gca,'YLim',[-1.2,1.2]); set(gca,'FontSize',25); set(gca,'XTick',0:pi/2:2*pi); set(gca,'XTickLabel',0:90:360); set(gca,'FontName','symbol'); set(gca,'XTickLabel',{'0','p/2','p','3p/2','2p'});
