How to show or hide the grid in the coordinate axis in MATLAB?

Time:2022-1-13

After the MATLAB drawing is completed, the grid needs to be input, and the hidden or displayed can be modified by command.

Software name:
Mathematical software MATLAB r2016a 64 bit full Special Edition (with crack file + key + installation tutorial)
Software size:
7.6GB
Update time:
2016-11-23Download now

1. There is a graph. We drew one here casually:plot(randn(100,1));

2. Then add the grid, and the added grid followsDimensions of X and Y axesOne by one.

grid on

You can also add a mesh that is minimized in the axis.

grid minor

3. You can also useSet commandconductModification of grid in coordinate axis, including color and linetype. Or use the previous graphics;

plot(randn(100,1));grid on;

After adding the following command line, the style in the second figure will appear.

set(gca,’gridline’,’:’,’gridcolor’,’r’);

4. You can also modify the mesh in other ways. Enter the of the drawing“Displays drawing tools and docked drawings”, view“More properties

5. It contains information aboutGrid properties, you can modify it manually.

Relevant recommendations:

How to change the font size in MATLAB?

How does matlab read the data in Excel file?

What if the command window is closed by mistake in MATLAB?