gnuplot:使用“图0”。并“图1”绘制矩形时
“图1”的一些启发感到高兴
我对使用“图0”和 图0和图1表示左右边界。
我正在关注第二个示例 http://gnuplot.sourplot.sourceforge.net/demo/retectangle。 html
reset session
set xrange [0:6]
set yrange [0:25]
set obj 1 rect from graph 0,graph 0 to graph 1,graph 1 fc "red" # paint the background
set obj 2 rect from graph 0,5 to graph 1,12 fc "green" # produces nothing
set obj 3 rect from 'graph 0', 3 to 'graph 1',10 fc "blue" # produces nothing
set obj 4 rect from 'graph 0', 4 to 6,8 fc "yellow" # this works. '...' and 6 required
plot 'data02.txt'
我想念什么?
我的gnuplot是Ubuntu 20.04.4 LTS上的5.2.8,
感谢您的帮助!
I'd be happy about some enlightenment on the use of "graph 0" and "graph 1":
Goal is to draw rectangles into a graph, but while painting the whole background works, horizontal stripes don't, when I try to use graph 0 and graph 1 to indicate the left and right boundaries.
I'm following the second example at http://gnuplot.sourceforge.net/demo/rectangle.html
reset session
set xrange [0:6]
set yrange [0:25]
set obj 1 rect from graph 0,graph 0 to graph 1,graph 1 fc "red" # paint the background
set obj 2 rect from graph 0,5 to graph 1,12 fc "green" # produces nothing
set obj 3 rect from 'graph 0', 3 to 'graph 1',10 fc "blue" # produces nothing
set obj 4 rect from 'graph 0', 4 to 6,8 fc "yellow" # this works. '...' and 6 required
plot 'data02.txt'
What am I missing?
My gnuplot is 5.2.8 on Ubuntu 20.04.4 LTS
Thanks for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么要编写例如
'图表0'
而不是图形0
?并检查
帮助坐标
:因此,例如
图0,5
和图0,12
将在图形外。您应该编写图0,第一个5
和图0,第一个12
或0,5
和0,12
如果您是指X-和Y-Coordine。实际上,在您的情况下,图形0
与第一个0
相同。因此,这取决于您想要的。检查以下脚本。
脚本:
结果:
Why do you write e.g.
'graph 0'
instead ofgraph 0
?And check
help coordinates
:Hence, e.g.
graph 0, 5
andgraph 0, 12
will be outside of the graph. You should writegraph 0, first 5
andgraph 0, first 12
or0,5
and0,12
if you mean the x- and y-coordinates. Actually, in your casegraph 0
is identical withfirst 0
. So, it depends what you want.Check the following script.
Script:
Result: