Gnuplot (Gaston.jl) backend for Plots

Dear Plot users,

Experimental gnuplot/gaston.jl backend has been merged into Plots.jl master branch (including a release). My primary goal is to have a lightweight backend in plots that supports REPL plotting. Since many users must be familiar with gnuplot, submitting PRs and extending the gnuplot backend should be easy.

Testing the backend:

Install Gaston.jl, by:

import Pkg; Pkg.update(); 
Pkg.install("Gaston")

and make sure that you have operational gnuplot installed in the system. The best way to test it is to see if Gaston.jl standalone package is working correctly for you.

Trying it out:

using Plots; gaston();
plot(1:10)

Currently src/gaston.jlis only 300lines long, so it should be easy for people eager to contribute to Plots to jump in. Browsing the source code should give an idea how Plots.jl works and what it takes to add new functionality.

Limitations:

  1. 2d Plots only (TODO add 3d plots)
  2. Simple grid layout
  3. Restricted saving options (TODO)
  4. No colorbars
  5. No docs
  6. More…

We are looking for more contributors and maintainers across all backends. If you were overwhelmed by Plots codebase before, perhaps browsing and understanding Gaston.jl backend code would help you to join the Plots developer community easily.

11 Likes

Thanks for putting this work together and add one more important backend to Plots.jl, as it has the most convenient syntax.

Some feedback from Windows 10 (Julia 1.7, Plots v1.22.4, Gaston v1.0.4):

  • Installing a recent version (5.4) of gnuplot for Windows causes hanging problems. The gaston() plot will display fine in a Qt window but, that window always freezes. This issue seems to have been reported in SO.

  • Gnuplot Version 5.2.8 from Sourceforge.net works fine. Used installer: gp528-win64-mingw.exe

When gnuplot misbehaves on Windows, it’s sometimes useful to set the default terminal to “windows” instead of qt.

1 Like

Followed your suggestion and installed windows terminal option for the latest version (gnuplot 5.4 patchlevel2), but still got the same hanging issue:gnuplot_5.4_patchlevel2_hanging
will thus revert back to 5.2.8.

Yeah, unfortunately it doesn’t always work. Fortunately, 5.2.8 is pretty solid.