首页 > 解决方案 > 我可以将评论放入长情节命令中吗?

问题描述

我的 gnuplot 绘图命令是

tM=1.0*(a0*xmax+ymax)
set parametric
set trange [-0.2:tM]
plot  1/0,1/0 title '\ict\qquad' lc rgb 'gray80' dt 5 lw 2,\
uldx0(t),uldy0(t) title '\disct' lc rgb 'web-green' lw 3,\
hpx0(t),hpy0(t) lc rgb 'pink'  lw 2,\
 vpx0(t),vpy0(t) with filledcurve xy= 0.5*(xmi0+xpl0),0\
 fs transparent solid 0.25 fc rgb 'cyan' ,\
for [n=1:5] ix0(n*0.05+t*n*0.005/tM ,u0(0,n*0.05)),\
iy0(n*0.05+t*n*0.005/tM,u0(0,n*0.05))\
 lc rgb 'gray80' dt 5 lw 2,\
for [n=6:10] ix0(n*0.05+t*n*0.01/tM ,u0(0,n*0.05)),\
iy0(n*0.05+t*n*0.01/tM,u0(0,n*0.05))\
 lc rgb 'gray80' dt 5 lw 2,\
  for [n=22:36] ix0(n*0.025+t ,u0(0,n*0.025)),\
iy0(n*0.025+t,u0(0,n*0.025))\
lc rgb 'gray80' dt 5 lw 2,\
x0(t*pmax0(q1)/tM,q1), y0(t*pmax0(q1)/tM,q1)  \
 lc rgb q1color lw 2,\
x0(t*pmax0(ql0)/tM,ql0),  y0(t*pmax0(ql0)/tM,ql0)  \
 lc rgb qlcolor lw 2,\
x0(t*pmax0(QqxyL0)/tM,QqxyL0), y0(t*pmax0(QqxyL0)/tM,QqxyL0)  \
 lc rgb qhatmicolor lw 2,\
x0(t*pmax0(q2)/tM,q2) ,  y0(t*pmax0(q2)/tM,q2)  \
 lc rgb q2color lw 2,\
x0(t*pmax0(qpl0)/tM,qpl0), y0(t*pmax0(qpl0)/tM,qpl0)   \
 lc rgb qplcolor lw 2,\
x0(t*pmax0(QqxyR0)/tM,QqxyR0), y0(t*pmax0(QqxyR0)/tM,QqxyR0)  \
 lc rgb qhatplcolor lw 2

有没有一种很好的方法可以用评论来打破这个问题,如果我决定稍后再看,这也会有所帮助吗?

标签: gnuplot

解决方案


全部在一个plot命令中,对吗?我认为最接近的是利用 plot 命令的每个子句都可以以定义开头的事实。预期用途类似于plot a=2 x**a,但您可以选择一些垃圾变量并将其分配给注释字符串

plot \
    _c="Straight line" x   title _c, \
    _c="Parabola" x**2     title 'x^2', \
    _c="Some weird function" real(sinh(sqrt(x))) title 'squint(x)'

如果您愿意,可以在情节标题中使用该注释字符串,这与最初的预期用途很接近。但你也可以在情节条款中忽略它。然后它只会与阅读源代码的人相关,而不是与 plot 命令的输出相关。


推荐阅读