gnuplot:如何在参数图中设置多个范围? [英] gnuplot: how to set multiple ranges in parametric plots?

查看:125
本文介绍了gnuplot:如何在参数图中设置多个范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以解释为什么第二条曲线不仅是从0,01,1的预期线,还是从0,02*pi,2*pi的线吗?为什么第二个范围[t=0:1]被忽略? 错误或功能,或者我错过了手册中的任何内容?

Can somebody explain why the second curve is not just the expected line from 0,0 to 1,1, but a line from 0,0 to 2*pi,2*pi? Why is the second range [t=0:1] ignored? Bug or feature or did I miss anything in the manual?

代码:

### parametric curves
reset session

set parametric
set size square

plot [0:2*pi] cos(t), sin(t) w l, \
     [t=0:1] t, t w l
### end of code

结果:

推荐答案

在plot命令的开始使用轴范围是历史的产物.它使程序以及用户感到困惑,并且由于在版本5中引入了采样范围,因此可能导致语法不明确.要消除语法歧义,您可以将关键字sample放在第一个绘图组件的范围说明符之前:

The use of axis ranges at the start of a plot command is a historical artifact. It confuses the program as well as the user, and since the introduction of sampling ranges in version 5 it leads to potentially ambiguous syntax. To disambiguate the syntax you can place the keyword sample in front of the range specifier for the first plot component:

set style data linespoints
set key left
plot sample [14:22:2] '+' u 1:1 pt "1" ti "sub-plot 1 sample interval 2", \
            [1:12:1]  '+' u 1:1 pt "2" ti "sub-plot 2 sample interval 1", \
            [33:66:6] '+' u 1:1 pt "3" ti "sub-plot 3 sample interval 6"

这篇关于gnuplot:如何在参数图中设置多个范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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