just another blog.
here you'll find my experiences with Matlab/Simulink, vba, LaTeX and Mac OS X.
Friday, June 20, 2008
How to change the color of the grid without changing the color of the ticks
Have you ever tried to change the color of the grid in a plot? right, the color of the axis changes as well. it is not possible to set the color of the grid separately. There is a good workaround here. ezplot('x') grid on set(gca,'Xcolor',[0.85 0.85 0.85]) c_axes = copyobj(gca,gcf); set(c_axes, 'color', 'none', 'xcolor', 'k', 'xgrid', 'off', 'ycolor','k', 'ygrid','off');
this will generate gray grids, like in the picture above.
sytax: gridaxeshandle=cgrid(colorarg, stylearg, colorargy)
ReplyDeletegridaxishandle=cgrid('g-');