Matlab设置坐标轴穿过原点
发布时间
阅读量:
阅读量
Matlab绘图功能在默认设置下,其坐标轴并不会经过坐标原点;具体示例如下:

插入以下代码,使坐标轴经过原点:
ax1.YAxisLocation = 'origin';
ax1.XAxisLocation = 'origin';
%%%%%%或者
set(gca,'YAxisLocation','origin');
set(gca,'XAxisLocation','origin');
clc;
clear;
close all;
f1 = figure(1);
ax1 = axes(f1);
ax1.YAxisLocation = 'origin';
ax1.XAxisLocation = 'origin';
axis([-4,5,-4,5]);
全部评论 (0)
还没有任何评论哟~
