Skip to content

Releases: benschneider/PyGnuplot

New PyGnuplot version !requires code adjustments

29 Sep 21:06

Choose a tag to compare

Main changes required in existing code is:

  1. Change import and Figure creation:

Before:
import PyGnuplot as gp
gp.c("plot sin(x))

Now:
from PyGnuplot import gp
fig1 = gp() # or fig1 = gp(r"path to gnuplot")
fig1.a("plot sin(x))

fig2 = gp()
fig1.a("plot sin(x))

fig2 = gp()
fig1.a("plot sin(x))
...

A quick workaround for existing code could be:
from PyGnuplot import gp as gp_class
gp = gp_class()
..
old code here
except gp.s needs to be changed into gp.save

now can create multiple figures, fit and get responses from gnuplot via the ask comment pi = fig1.a('print pi')

What is fixed:

Sometimes Gnuplot was still open in the background, this issue is somewhat addressed.
-> 'Somewhat' because one can still have multiple idle Gnuplot sessions opened in the background if one
overwrites the old gp instance without closing it. -> I.e. the interaction handle gets lost without gnuplot closing.
Fig1 = gp_class() # creates Gnuplot handle 1
Fig1.close() # <- this is needed before re-assigning
Fig1 = gp_class() # creates another Gnuplot handle and overwrites the old one Fig1 variable.

What's Changed

New Contributors

Full Changelog: 0.11.16...0.12.3

Plot with labels

27 Feb 15:20

Choose a tag to compare

Using a manual save option to allow text/label saving of data, which
also removed all the numpy dependencies.
delimited was changed from , to ' ' space.

Figure functions working in Windows.

02 Nov 16:42

Choose a tag to compare

A bug preventing the creation of new figures is removed.
Using universal_newlines in the pipe command instead of a byte-array conversion, this should keep the code cleaner and simpler.

For windows still setup the terminal i.e.:
import PyGnuplot as gp
gp.default_term = 'wxt'

For Python 2 and 3

31 Oct 16:01

Choose a tag to compare

No new features, just ensuring functionality for Python 3.4+.

Version working in Python 2.7 (not yet 3.4+)

25 Jun 23:23

Choose a tag to compare

Added simple option to change default terminal:
change the variable default_terminal in the imported PyGnuplot package (see example).

Each figure has its own process and terminal allowing to switch between figures
and also to have certain figures reserved for pdf/png or other outputs.