ax.xgrid in matlab

To show grid lines in the x-axis in MATLAB, you can use the xgrid function. Here's an example:

main.m
x = 1:10;
y = x.^2;

plot(x, y)
xgrid on
41 chars
6 lines

This code will plot the values of y against x and then turn on the grid lines on the x-axis using xgrid on. You can customize the appearance of the grid lines using the grid function.

related categories

gistlibby LogSnag