@@ -1354,29 +1354,46 @@ _with='image', tuplesize=3). See the documentation for plot() and class
1354
1354
gnuplotlib for full details.
1355
1355
1356
1356
** wait()
1357
- Waits until the open interactive plot window is closed
1357
+ Waits until the given interactive plot window(s) are closed
1358
1358
1359
1359
SYNOPSIS
1360
1360
1361
1361
#+BEGIN_SRC python
1362
1362
import numpy as np
1363
1363
import gnuplotlib as gp
1364
1364
1365
- gp. plot(np.arange(5))
1366
-
1365
+ ### Waiting for the global plot window
1366
+ gp.plot(...)
1367
1367
# interactive plot pops up
1368
-
1369
1368
gp.wait()
1370
-
1371
1369
# We get here when the user closes the plot window
1370
+
1371
+
1372
+ ### Waiting on some arbitrary plots
1373
+ plot0 = gp.gnuplotlib(...)
1374
+ plot1 = gp.gnuplotlib(...)
1375
+ plot0.plot(...)
1376
+ plot1.plot(...)
1377
+ gp.wait(plot0,plot1)
1378
+ # We get here when the user closes the plot windows
1372
1379
#+END_SRC
1373
1380
1381
+
1374
1382
DESCRIPTION
1375
1383
1376
- This applies to the global gnuplotlib object.
1384
+ Wait for the interactive plot window(s) to be closed by the user. Without
1385
+ any argument this applies to the global gnuplotlib object. Or the specific
1386
+ plots to wait for can be given in arguments (in-line or as a single
1387
+ iterable):
1388
+
1389
+ - wait() waits on the global gnuplot object
1390
+
1391
+ - wait(plot0,plot1)
1392
+ - wait((plot0,plot1),) both wait on the given gnuplotlib objects
1377
1393
1378
- It's not at all trivial to detect if a current plot window exists. If not,
1379
- this function will end up waiting forever, and the user will need to Ctrl-C
1394
+ It's not at all trivial to detect if a plot object has an open plot window.
1395
+ If it does not, this function will end up waiting forever, and the user will
1396
+ need to Ctrl-C
1380
1397
1381
1398
** add_plot_option()
1382
1399
Ingests new key/value pairs into an option dict
0 commit comments