GNUPLOT可以动态准备索引标签吗? [英] Can GNUPLOT dynamically prepare index labels?

查看:66
本文介绍了GNUPLOT可以动态准备索引标签吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在GNUPLOT中绘制一个多图,并且为了节省空间,我只在其中一个图上绘制了轴标签.对于其他情节,我使用

I'm plotting a multiplot in GNUPLOT and in order to save space, I only plot the axis labels on one of the plots. For the other plots, I overwrite the tics-labels using

set ytics ("" -20, "" -15, "" -10, "" -5, "" 0, "" 5, "" 10, "" 15, "" 20)

对于这样的小规模,它可以手动执行.我可以使用内置的gnuplot(for循环)动态编写此范围"吗?

For a small scale like this, its doable manually. Can I use a gnuplot built-in (for-loop) to dynamically write this "range"?

推荐答案

是的,可以这样

numtics = 8

set macros

ticstring = '('

do for [i=0:numtics] {
    ticstring = ticstring.'"" '.(-20 + i*5).', '
}

ticstring = ticstring.'"" 20)'

set ytics @ticstring

在您的情况下,可能更简单的命令是

What may be simpler in your case would be the command

set ytics format "" 5

每5个抽签中会有一个空白标签.

Which will put a tic every 5 with a blank label.

这篇关于GNUPLOT可以动态准备索引标签吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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