matlab的grid网格线属性设置,修改网格线密度

本文介绍了在matlab中如何调整网格线的密度,包括打开关闭网格线、设置线型和透明度,以及三种控制网格线密度的方法,强调了XTick与XTickLabel的区别,并提供了示例操作。
摘要由CSDN通过智能技术生成

matlab帮助文档的grid参数表

在画图的时候发现有一根线刚好和网格线重叠了,导致显示的不太清楚,然后就想修改一下网格线的位置,然后将实现过程写了下来。
查了下资料发现基本都是修改了网格坐标轴也发生变化,如果想实现坐标轴数值和网格线分别设置,直接阅读设置网格线密度中的方法3。
属性 描述
XTick, YTick, ZTick Location of tick marks and major grid lines for each axis direction
XGrid, YGrid, ZGrid Display of major grid lines for each axis direction
XMinorGrid, YMinorGrid, ZMinorGrid Display of minor grid lines for each axis direction
LineWidth Line width of grid lines, axes box outline, and tick marks
GridLineStyle Major grid line style
MinorGridLineStyle Minor grid line style
GridColor Major grid line color
MinorGridColor Minor grid line color
GridAlpha Major grid line transparency
MinorGridAlpha Minor grid line transparency
Layer Location of grid lines with respect to the plotted data

几种常用的操作

1、打开关闭网格线

grid on;  % 打开
grid off;  % 关闭

2、设置线型,以虚线为例(线型的参数和plot线型是一样的)

set(gca, 'GridLineStyle', ':');  % 设置为虚线

  • 90
    点赞
  • 419
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值