Home> Common Problem> body text

How to use axis function in Matlab

小老鼠
Release: 2023-11-23 15:58:10
Original
3208 people have browsed it

Usage of axis function in Matlab: 1. axis([xmin xmax ymin ymax]): This statement sets the range of the x-axis to xmin to xmax, and sets the range of the y-axis to ymin to ymax; 2. axis('equal'): This statement sets the ratio of the x-axis and the y-axis to be equal so that the shape drawn on the graph will not be stretched or compressed; 3. axis('off'): This statement turns off the coordinate axis ;4. axis('tight') and so on.

How to use axis function in Matlab

#In Matlab, the axis function is used to control the range and scale of the coordinate axis. Its usage is as follows:

1. axis([xmin xmax ymin ymax]): This statement sets the range of the x-axis to xmin to xmax, and sets the range of the y-axis to ymin to ymax.

Example:

x = 0:pi/100:2*pi; y = sin(x); plot(x,y); axis([0 2*pi -1 1]);
Copy after login

2. axis('equal'): This statement sets the scale of the x-axis and the y-axis to be equal so that the shape drawn on the graph will not be stretched. or compression.

Example:

x = 0:pi/100:2*pi; y = sin(x); plot(x,y); axis('equal');
Copy after login

3. axis('off'): This statement turns off the coordinate axis.

Example:

x = 0:pi/100:2*pi; y = sin(x); plot(x,y); axis('off');
Copy after login

4, axis('tight'): This statement sets the range of the coordinate axis to be equal to the minimum and maximum values of the plotted data, but it will not automatically Adjust the proportions.

Example:

x = 0:pi/100:2*pi; y = sin(x); plot(x,y); axis('tight');
Copy after login

The above is the detailed content of How to use axis function in Matlab. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!