gnuplot多个图不是交互式的 [英] gnuplot multiple graphs are not interactive

查看:73
本文介绍了gnuplot多个图不是交互式的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过gnuplot中的shell脚本绘制多个图形. 图形已正确绘制,但无法放大.是否需要设置任何变量? 这是代码:

I am drawing multiple graphs via a shell script in gnuplot. The graphs are drawn correctly, but am not am able to zoom in . Does any variable need to be set? Here is the code:

---   for loop of script starts---
    gnuplot -persist <<EOF
            set term x11 1
            set title "IP : $ip Upstream capacity:$UP_CAP kbps"
            plot 'trace-0-dir1.txt' using (\$1-$min1):(\$2-\$1-$mindelay1) with lp
            set term x11 2
            set title "IP: $ip Downstream capacity:$DOWN_CAP kbps"
            plot 'trace-0-dir2.txt' using (\$1-$min2):(\$2-\$1-$mindelay2) with lp

    EOF
   ---for loop ends---

推荐答案

从"x11 1"窗口切换开后,将禁用缩放功能.要重新获得控制权,应切换回特定窗口(set term x11 1).另一个问题是x11终端.您应该使用可以使Windows保持活动状态的wxt.

Once you switch away from the "x11 1" window the zooming is disabled. To regain control, you should switch back to the specific window (set term x11 1). Another issue is the x11 terminal. You should use wxt which can keep windows alive.

您可以通过使用wxt终端并分离两个绘图命令来解决您的问题,因此不必离开窗口:

You can solve your issue by using the wxt terminal and separating the two plot commands, therefore not switching away from the window:

---   for loop of script starts---
gnuplot -persist <<EOF
set term wxt
set title "first"
plot x
EOF
gnuplot -persist <<EOF
set term wxt
set title "second"
plot x**2
EOF
---for loop ends---

这样,您将打开两个可缩放窗口,并且仍然可以使用shell变量.

With this, you have two zoomable windows open and you can still use your shell variables.

通常,您不必必须打开控制台才能拥有活动的窗口,而只是一个合适的终端.特别是命令

In general, you do not have to have console open in order to have active windows, just an appropriate terminal. Especially, the command

gnuplot --persist -e 'plot[0:10] sqrt(x)'

如果与wxt一起使用,

会产生可滚动和可缩放的窗口.试试

produces scrollable and zoomable windows if used with wxt. Try

gnuplot --persist -e 'set term wxt; plot[0:10] sqrt(x)'

希望这会有所帮助.

这篇关于gnuplot多个图不是交互式的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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