SciPlot Widget

A full-featured GTK4 widget to display 2D data in a graph. It is intended to display scientific data, and can format the data in polar or cartesian plots (log axes available for cartesian plots).


Current Version

The current version is 1.37, a GTK4/Cairo/Pango port of the original X11/Xt widget. Source is available from the repository.


Screen Shots

A few images showing the format and capabilities of the SciPlot widget.


Overview

The SciPlot Widget is a GTK4 widget capable of plotting cartesian or polar graphs, including logarithmic axes in cartesian plots. It is implemented as a GObject subclass of GtkWidget and draws using the Cairo 2D graphics library with Pango for text layout.

Features provided in the widget include automatic scaling, legend drawing, axis labeling, PostScript output, multiple plotted lines, color support, user font specification, dashed lines, symbols drawn at points, logarithmic scales on one or both axes in cartesian plots, and degrees or radians as angles in polar plots.


Features

Features provided in the widget include the following:

See the demo program information page for compilation instructions and sample programs.


Requirements

The SciPlot widget requires GTK4 (4.0 or later), Cairo (with PostScript support), and Pango/pangocairo. Build uses autoconf/automake and pkg-config. A C99 compiler is required.


History

The SciPlot widget was originally written by Rob McMullen in 1994 as an X11/Xt widget, developed on an IBM RS/6000 running AIX 3.2.4 and X11R5. It was widely used with Athena, Motif, and other Xt-based widget sets.

In 2026, the widget was ported to GTK4/Cairo/Pango by Barak A. Pearlmutter as part of the Debian package maintenance. The X11/Xt widget infrastructure was replaced by a GObject-based GTK4 widget subclass. Drawing is now performed via Cairo in the snapshot() virtual method using a retained display list. Font metrics and text rendering use Pango. Vertical text rendering, which previously used an X11 pixmap rotation technique, now uses cairo_rotate(). PostScript output uses Cairo's PS surface rather than manual PS generation. The Motif-based utility dialogs were rewritten using GTK4 widgets.

The first X11 plotting widget that Rob McMullen encountered was the libXG package written by Sundar Narasimhan <sundar@ai.mit.edu>, which inspired the original SciPlot design.


Author's Note

This widget is supplied as free software under the GNU Library General Public Licence. If you use this widget, please include mention of the SciPlot widget in your documentation and retain the copyright notice.

The original author can be reached at <rwmcm@orion.ae.utexas.edu>. The Debian package is maintained by <bap@debian.org>.


Thanks

Thanks to the following people for providing fixes and suggestions to the original X11 version:


Copyright

Copyright (c) 1996 Robert W. McMullen
Copyright (c) 2026 Barak A. Pearlmutter (GTK4/Cairo port)

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


SciPlot : Programmer's Reference | Demo Programs

Originally by Rob McMullen. GTK4 port by Barak A. Pearlmutter. Updated: 2 Jun 2026