Skip to content

About FIGURE ​

FIGURE (Fortran Immediate-mode GUI for User interfaces, Rendering and Exploration) is a Fortran library for graphical user interfaces: control panels for a computation, live plots of its data, small interactive tools. It binds Dear ImGui and ImPlot, through their C APIs cimgui and cimplot, and runs them on SDL3 and OpenGL 3.

A FIGURE program is one loop. Every iteration declares the whole interface; each widget call draws the widget and returns what the user did with it during that frame:

fortran
call app%init('FIGURE: first window', 640_int32, 360_int32)
do while (app%next_frame())
   if (ig_begin('Hello')) then
      call ig_text('Hello from Fortran.')
   endif
   call ig_end()
enddo
call app%destroy()

The state of the interface is the program's own variables: a slider is bound to a real(real64) by passing it, and the slider writes the new value into it when the user drags. See Why immediate mode for what this changes with respect to retained-mode toolkits.

exe/examples/figure_hello, the example of the repository

Status ​

FIGURE v0.8.0 is released (2026-11-19), grown from its applications outside this repository, tools and a GUI for a CFD solver (showcase). The API can still change before v1.0 (roadmap).

What exists today:

  • the application loop: a window, the frame loop, lazy redraw; headless mode for tests; remote mode, the interface in a web browser; the window's title, a confirmation before quitting;
  • widgets: windows, buttons, check boxes, sliders (int32, real32, real64), numeric fields, text fields bound to character variables, drop-down lists, tooltips, selectable lines, wrapped and coloured text, child regions, collapsing headers, tabs, tables, disabled blocks, long lists drawn in view only, workspace buttons (an icon above the label), the Dear ImGui demo window;
  • menus (the main menu bar, a window's), keyboard shortcuts (cmd on macOS), popups and modals; the system's file dialogs;
  • docking: dock spaces, layouts set by the program, windows that appear later, a bar along a side of the window; the user's arrangement saved to a file and loaded back while the program runs;
  • styles: seven built-in themes, every colour and size by name, theme files, fonts (bundled or from a file) and their size, changed at run time; Lucide icons in every font, by name (ICON_*);
  • plots of real(real32) and real(real64) arrays, read in place: lines (also of matrix rows, with a stride), scatter, bars, shaded areas, with styles; logarithmic axes, tick label formats, subplots with linked axes; heatmaps with their colour scale; images (texture_object), in a plot or as a widget;
  • a code editor: highlighting (Fortran, input files, the program's own languages), marks on lines, completion, find and replace, a diff of two texts;
  • 3-D views of meshes coloured by fields, with a view cube and gizmos that move a clipping plane, a box or a probe by hand; colormaps edited by their stops;
  • 3-D plots (ImPlot3D): trajectories, probes, height surfaces and small meshes over labelled axes;
  • Markdown: help pages with headings, tables and code, their links reported to the program, a table of contents and a search;
  • pictures: a rectangle of the window saved as a PNG by the program; every frame recorded, with scripted input, for documentation;
  • headless testing with synthetic input (figure_testing, in the library);
  • CI on Linux, macOS and Windows with gfortran, on Linux with nvfortran and Intel ifx; builds with FoBiS and fpm; a real window opened and its frames checked on the three systems.

The feature map lists every public procedure.

What it is not ​

  • Not a retained-mode toolkit: there is no widget tree and no event callback into Fortran. A widget call returns what the user did this frame, and the program asks (Why immediate mode). The one procedure of a program that FIGURE runs is a task's work, on a thread of its own.
  • No multi-viewports: docking is on, but a window cannot be dragged out of the main window into a window of its own (Known issues).
  • Not every Dear ImGui widget is wrapped, and the generated raw layer (figure_cimgui, figure_cimplot, figure_cimplot3d and their _enums) is internal: programs call the wrappers, and a Dear ImGui or ImPlot function without one is listed as "raw only" in Dear ImGui names.

The other limits, by subject, are in Known issues; what comes next is in the roadmap.

Where to start ​

  1. Install FIGURE with the one-line installer; the same page has the other routes, building from the repository among them.
  2. Follow the tutorial: from a first window to a finished application, the solver studio.
  3. Look up a task in the cookbook, a procedure in the reference or the API.

Licence ​

FIGURE is released under the MIT licence. It compiles Dear ImGui, ImPlot, cimgui, cimplot and miniz (MIT) and SDL3 (zlib) into its native libraries, and embeds the IBM Plex Sans font (OFL-1.1) and the Lucide icons (ISC); THIRD_PARTY.md lists them, with what a program built with FIGURE must carry when it is distributed (the MIT notices; the native build installs them under share/licenses/).

Authors ​

Released under the MIT licence.