Matlab drawing, x-axis and y-axis scale non-uniform control, draw a good-looking picture

1. Learning content:

Use matlab to draw pictures, control the x-axis and y-axis scale to display related codes


2. Related codes:

1. The viewpoint of the coordinate axis (viewpoint):

1、坐标轴的视点(viewpoint):从哪个方向看整个坐标系统,这决定了坐标轴的方向和位置,通过view函数实现视点的设置;

view([z y ])(将坐标系统想象为一座房子,而自己是个会飞的天使,最初你在房子的北,海拔角度为0的位置,这是时你的视角是view[0 0],之后可以根据需要设置z和y的值,分别是绕房子转动的方向,和沿空间轴向上妃的高度)z表示视角沿z轴(正方向)旋转的角度,y表示视角沿y轴(水平面)旋转的角度

2. Coordinate axis display, close, style



axis off; % 去掉坐标轴

axis tight; % 紧坐标轴

axis equal; % 等比坐标轴

axis([-0.1, 8.1, -1.1, 1.1]); % 坐标轴的显示范围

% gca: gca, h=figure(...);

set(gca, 'XLim',[3 40]); % X轴的数据显示范围

set(gca, 'XTick',[-3.14,0,3.14] ); % X轴的记号点

set(gca, 'XTicklabel',{
    
    '-pi','0','pi'}); % X轴的记号

set(gca, 'XTick', []); % 清除X轴的记号点

set(gca, 'XGrid','on'); % X轴的网格

set(gca, 'XDir','reverse'); % 逆转X轴

set(gca, 'XColor','red'); % X轴的颜色

3. Set the x and y axis positions

set(gca,'YAxisLocation','right') % y轴的刻度设置到右侧

3. Related resources

1. Matlab's dark skills for drawing histograms and line charts
2. Remove the black grid lines when drawing in matlab, and add the command after the drawing statement: shading interp so that the whole picture will be continuous and smooth. Or h = surf(). set(h,'edgecolor','none'). % If you do not want smooth interpolation at the boundary
3, legend insert box
4, Matlab drawing: equidistant coordinate distance means unequal interval data value
how to change the scale range of matlab, if you change the scale font size of the coordinate axis
5, coding | matlab + double vertical axis +plotyy
6. There is no grid line in the picture, how does matlab control the display content of the coordinate axis without changing the shape of the curve
7. Matlab changes the size of the figure
8. Matlab coordinates are uneven
9. Matlab coordinates modify gca------- --Recommendation
10. Matlab drawing full-frame coordinate axis
11. MATLAB setting coordinate axis line thickness
12. Matlab, Mathematica, Python to realize the drawing of truncated coordinate axis effect
②Matlab, Mathematica, Python to realize the truncated coordinate axis effect drawing
13
14. MATLAB adjusts the display of the coordinate axis scale 15.
Rotation of the coordinate axis label, title, and xticklabel of the figure in matlab
16. Draw a broken line/histogram in matlab (the abscissa is Strings, and other precautions)
17. Draw a good-looking histogram in matlab
18. Matlab produces a paper picture
19. Beautiful pictures drawn in matlab
20. Some control methods of Legend in MATLAB
21. How Matlab can really control legend freely (turn!!!!)


Guess you like

Origin blog.csdn.net/qq_44368508/article/details/127226470