Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two interactive windows in Gnuplot with wxt terminal

Tags:

gnuplot

I often use the wxt terminal of Gnuplot to do some quick data inspection. I like the interactivity, such that I can easily gain control and zoom/move et cetera.

Suppose I have to following script

set terminal wxt 0 persist
plot x

set terminal wxt 1 persist
plot x**2

Now, on window 1 I have the interactive control. However, on window 0 this interactive control is lost.

My question is: How can I obtain interactive control on window 0?

I am using gnuplot 4.6.2. I've seen gnuplot multiple graphs are not interactive but the question in about x11 terminal, and the answers consist of opening multiple instance of gnuplot, which seems unnecessary to me.

like image 271
Bernhard Avatar asked Jun 04 '14 12:06

Bernhard


1 Answers

I believe have found a workaround for this problem. But not sure if this works for all cases.

My solution sounds like obvious. I created three files: configs.plt, wxt1.plt, and wxt2.plt.

The configs.plt file contains:

set style line 1 lc "#e41a1c"
set style line 2 lc "#377eb8"

The wxt1.plt file contains:

set terminal wxt title "plot sin"
load "configs.plt"
plot sin(x) w l ls 1

The wxt2.plt file contains:

set terminal wxt title "plot cos"
load "configs.plt"
plot cos(x) w l ls 2

screen capture

The only boring thing is run two instead one file.

like image 170
GRSousaJr Avatar answered Oct 14 '22 12:10

GRSousaJr