How do I set grid spacing in gnuplot

为君一笑 提交于 2019-12-13 11:44:54

问题


I have yaxis from 0 to 100. I want a grid line after every 10 units. How can I do that? That is, how can I draw grid lines after each 10 units?


回答1:


Have a look at "help grid", you probably want to do something like

set yrange [0:100]
set xrange [0:10]

set grid ytics mytics  # draw lines for each ytics and mytics
set mytics 2           # set the spacing for the mytics
set grid               # enable the grid

plot sin(x)*100



回答2:


The ytics variable controls how often or sparse the y scale values will be printed and thus the grid lines will be drawn.

set ytics 10  # y scale marks and values will be at every 10th unit
set grid      # grid turned on at each scale values
replot        # replot your graph

The mytics controls the minor marks on the y scale. The set grid mytics makes the y scale minor grid lines visible.



来源:https://stackoverflow.com/questions/20069093/how-do-i-set-grid-spacing-in-gnuplot

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!