about 10 years later, let me point the attention to autogpy or Autognuplotpy
.
Autogpy aims at a full generation of gnuplot scripts (and suitably dumped data) from python.
For instance, the python code
import autogpy
import numpy as np
xx = np.linspace(0,6,100)
yy = np.sin(xx)
zz = np.cos(xx)
with autogpy.AutogpyFigure("test_figure") as figure:
# gnuplot-like syntax
figure.plot(r'with lines t "sin"',xx,yy)
# matplotlib-like syntax
figure.plot(xx,zz,u='1:2',w='lines',label='cos')
generates the gnuplot script
set terminal epslatex size 9.9cm,8.cm color colortext standalone 'phv,12 ' linewidth 2
set output 'fig.latex.nice/plot_out.tex'
p "fig__0__.dat" with lines t "sin",\
"fig__1__.dat" u 1:2 with lines t "cos"
and dumps readable data.
Supports latex, tiks and png terminal, but can be easily expanded to more.
Disclaimer: I am the author.