[SciPy-User] Best way to feed data to Gnuplot?
Alex Leach
beamesleach at gmail.com
Wed Mar 27 13:39:43 EDT 2013
On Wed, 27 Mar 2013 17:26:01 -0000, Andrew Fraser <afraser at lanl.gov> wrote:
> I switched from gnuplot to matplotlib in 2008. The new code is a little
> easier to read but the plots from gnuplot looked better.
You beat me to it! +1 for matplotlib. I only used gnuplot for about 3
months, also in 2008, before switching to matplotlib. True, the graphs
don't look as nice, but my code does; I haven't looked back...
On Wed, 27 Mar 2013 16:45:06 -0000, Florian Lindner <mailinglists at xgm.de>
wrote:
> Is there a better way? What is the best to print the numpy data in the
> correct
> format?
Have you considered using matplotlib[1]? It interfaces with numpy arrays
really well.
In days long gone, I wrote formatted strings to gnuplot-compatible text
files, and then called gnuplot with Python's os.system. It wasn't a very
elegant solution at all..
matplotlib is at first overwhelmingly large, as it provides both an Object
Oriented API[2], and also tries to emulate a very similar interface to
matlab (aka matplotlib.pyplot[3]). When used in conjunction with numpy,
scipy (and ipython), it goes by the name pylab[4].
Cheers,
Alex
[1] http://matplotlib.org/
[2] http://matplotlib.org/1.2.1/api/index.html
[3] http://matplotlib.org/1.2.1/api/pyplot_summary.html
[4] http://www.scipy.org/PyLab
More information about the SciPy-User
mailing list