Skip to content

Comparison ​

foresight sits between three families of tools: gnuplot and its front ends, which drive an external plotter; Fortran wrappers of gnuplot or matplotlib; and pure Fortran plotting libraries that write images. Its niche is the combination none of them covers: pure Fortran, interactive pages that need nothing to view, gnuplot usage, live monitoring.

foresightgnuplotfeedgnuplotogpf, gnufor, fplotpyplot-fortranfplotlibfortplot
Runtime dependencynone—gnuplot, PerlgnuplotPython + matplotlibnonenone (ffmpeg for video)
Language of the plotterFortranCgnuplotgnuplotPythonFortranFortran
Callable from Fortranyesnonoyesyesyesyes
gnuplot command languagesubsetfullthrough optionsfull (through gnuplot)nonono
Interactive zoom/panself-contained HTML pageown window; HTML page (canvas terminal)gnuplot windowgnuplot windowmatplotlib windownono
Live monitoring of files--watch: reloading pages that keep or follow the view; text redrawn in placereplot/reread loops--stream, scrolling window (--xlen)nononono
Terminal outputcharacters, Unicode blocks, Braille, ANSI colorsdumb, block, sixel graphicsthrough gnuplotthrough gnuplotnonoASCII
Static formatsSVGmanythrough gnuplotthrough gnuplotthrough matplotlibSVG, PNG, PDF, EPS, GIFPNG, PDF; video through ffmpeg
Functions of x (plot sin(x))yesyesyes (--equation)yesnonono
2D plot stylesevery gnuplot 2D style (lines to spider plots, heatmaps, polar); pies, gauges, readoutsallthrough gnuplotthrough gnuplotthrough matplotlibmanymany
Smoothing, histogramssmooth, 11 filters; binssmooth, 13 filters; binsthrough gnuplotthrough gnuplothistogramshistogramshistograms
Fittingfit, gnuplot's Marquardt-Levenberg, in scripts and from Fortranfitthrough gnuplotthrough gnuplotnonono
3D, contourssplot in 3D views and the map view: meshes with hidden lines, pm3d surfaces (depth sorted, lit), contours, filled contours, gridded and masked surfaces, error bands, 3D bars, polygons, grid walls; turned by the mouse in the HTML page (a sketch of the plot while turned)yesthrough gnuplotthrough gnuplotcontours, 3Dcontours, 3D axescontours, 3D lines

The rows on other projects summarise their documentation as of October 2026 (feedgnuplot, fplotlib, fortplot, pyplot-fortran, fplot); check them for their current state.

Closest relatives ​

  • gnuplot's canvas terminal writes an HTML page with mouse zoom, the nearest thing to a foresight page. It needs gnuplot to write it, and its helper scripts (canvastext.js, gnuplot_common.js) next to the page or at a URL (jsdir); a foresight page is one file, written by the Fortran program itself.
  • feedgnuplot is the closest to --watch: it pipes a stream into gnuplot and redraws it, with a scrolling window of the recent past. foresight watches files rather than a pipe — the job writes its log as it would anyway — and the viewer's follow mode (f) gives the same scrolling window in the page.
  • fplotlib and fortplot are pure Fortran like foresight, with raster output and 3D; they write images, not interactive pages, and read no gnuplot.

Layout compared with gnuplot ​

foresight lays a gnuplot script's page out as gnuplot 6.0 does, and measures how close it gets on gnuplot's own demos (scripts/fidelity/, see Contributing). The differences left by design:

  • Text widths. foresight measures every text with the metrics of its compiled-in fonts (advance widths and kerning, see Fonts); gnuplot's layout estimates a text as its number of characters times a character width. Where labels are narrow (-1, 1.5, σ), foresight's margins and key boxes are narrower than gnuplot's and the plot area wider.
  • Titles. A panel's title takes gnuplot's room above the plot (a character height, its lines, a character height), as do the cells of a multiplot layout under a multiplot title. Panels placed by set origin and set size under a multiplot title start below foresight's title band, not over it as gnuplot draws them.
  • Text devices keep foresight's rows of character cells for titles and labels.

When to use something else ​

  • Publication figures with LaTeX typesetting and fine layout control: pgfplots, matplotlib.
  • Raster output (PNG) or 3D projections from pure Fortran: fplotlib, fortplot.
  • The full gnuplot language (3D views beyond the splot map view, the interactive terminals): gnuplot itself.
  • Fields on meshes: ParaView through VTKFortran.

Released under the GPL v3, BSD 2-Clause, BSD 3-Clause or MIT License.