如何在Matlab图中启用次要网格线? [英] How can I enable the minor grid lines in a Matlab plot?

查看:725
本文介绍了如何在Matlab图中启用次要网格线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参见文档:

  • 使用grid ongrid off,您可以显示或隐藏主要网格.
  • 使用grid minor,您切换次要网格线的可见性.这意味着,如果多次运行包含grid minor的绘图脚本,则次要网格将被显示或隐藏,具体取决于它是运行奇数次还是偶数次.有没有一种方法可以始终显示次网格,而无需切换? grid minor on之类的东西.
  • With grid on and grid off, you can show or hide a major grid.
  • With grid minor, you toggle the visibility of the minor grid lines. This means that if a plot script containing grid minor is run multiple times, the minor grid will be shown or hidden depending on whether it was run an odd or even number of times. Is there a way to always show the minor grid, so without toggling? Something like grid minor on.

推荐答案

您可以将轴的XMinorGridYMinorGridZMinorGrid属性设置为'on'.

You can set the XMinorGrid, YMinorGrid and ZMinorGrid properties of your axes to 'on'.

surf(peaks)
set(gca,'XMinorGrid','on');
set(gca,'YMinorGrid','on');
set(gca,'ZMinorGrid','on');

这篇关于如何在Matlab图中启用次要网格线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆