本文介绍了如何在Matlab图中启用次要网格线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请参见文档:
- 使用
grid on
和grid off
,您可以显示或隐藏主要网格. - 使用
grid minor
,您切换次要网格线的可见性.这意味着,如果多次运行包含grid minor
的绘图脚本,则次要网格将被显示或隐藏,具体取决于它是运行奇数次还是偶数次.有没有一种方法可以始终显示次网格,而无需切换?grid minor on
之类的东西.
- With
grid on
andgrid 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 containinggrid 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 likegrid minor on
.
推荐答案
您可以将轴的XMinorGrid
,YMinorGrid
和ZMinorGrid
属性设置为'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图中启用次要网格线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!