grid2 - add a grid to 2D plots

This function adds a grid to a 2D plot which can be modified.
1.1K Downloads
Updated 21 Oct 2005

No License

This function adds a grid to 2D plots. The grid contains out of lines which can be modified by linestyles and color information. This function expands the functionality of the normal grid implemented in MATLAB plots.

plot(rand(1,10));
set(gcf,'color',[1 1 1]);
grid2(gca,'color',[0.7 0.7 0.7],'linewidth',3);

Cite As

Stefan Schuberth (2024). grid2 - add a grid to 2D plots (https://www.mathworks.com/matlabcentral/fileexchange/8758-grid2-add-a-grid-to-2d-plots), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP2
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0

Example added