当前位置:网站首页>matlab绘图|坐标轴axis的一些常用设置
matlab绘图|坐标轴axis的一些常用设置
2022-07-25 09:22:00 【霜溪】
图形的用处有很多,我们在阅读一些论文时,常常会看见一些非常精美的图片,这会使得我们对于内容的理解更加深刻。常用的绘图之前已经写过,这里写一下绘完图后,如何对坐标轴进行设置,使得图片更加符合实际需要!
基本图形:

代码:x=0:pi/4:2*pi;y=sin(x);plot(x,y,'-co');
这个图是直接画出的,下面对其坐标轴进行一些设置!
![]()
01
axis off:关闭所有的坐标轴标签、刻度、背景
x=0:pi/4:2*pi;y=sin(x);plot(x,y,'-co');axis off;


02
axis([xmin xmax ymin ymax]):设置图形的坐标范围,分别为x轴的最小、最大值,y轴的最小最大值。
x=0:pi/4:2*pi;y=sin(x);plot(x,y,'-co');axis([0,2*pi,-1,1]);
![]()
03
axis ij:将坐标轴设置为矩阵模式。此时水平坐标轴从左到有取值,垂直坐标从上到下
x=0:pi/4:2*pi;y=sin(x);plot(x,y,'-co');axis ij;


04
axis square:将坐标轴设置为正方形
x=0:pi/4:2*pi;y=sin(x);plot(x,y,'-co');axis square;


05
axis equal :设置屏幕高宽比,使得每个坐 标轴的具有均匀的刻度间隔
x=0:pi/4:2*pi;y=sin(x);plot(x,y,'-co');axis equal;

公众号:简单编程之旅
欢迎关注!

边栏推荐
猜你喜欢
随机推荐
OC--继承和多态and指针
TCP network application development process
Redis installation (Ubuntu)
Flutter rive multi state example
Assignment 7.21 Joseph Ring problem and decimal conversion
Flex layout syntax and use cases
学习 Redis linux 安装Redis
STM32+HC05串口蓝牙设计简易的蓝牙音箱
[code source] daily question - queue
Definition of cell
Neural network method -- Boston house price (regression problem)
The jar package has been launched on Alibaba cloud server and the security group has been opened, but postman still can't run. What should we do
Numpy - Construction of array
cf #785(div2) C. Palindrome Basis
## 使用 Kotlin USE 简化文件读写
¥ 1-3 SWUST OJ 942: reverse sequence table
How to customize the title content of uni app applet (how to solve the problem that the title of applet is not centered)
【数据挖掘】第三章 数据分析基础
学习新技术语言流程
微信小程序初步了解及实现底部导航栏









