Franklin and Plots in Julia

Overview

Julia has many packages that offer plotting capacity and you can use any of them in Franklin as long as the resulting plot is showable as SVG or PNG or has a custom show method.

One key difficulty is that if you want your site to be built remotely (e.g. by GitHub Action) then you need to ensure that the relevant dependencies (if any) are installed to enable this. We discuss this for each of the plotting package below. Remember that you also must add the relevant plotting library to your website environment using Pkg.jl e.g. with something like

using Pkg; Pkg.add("Plots")
⚠️ Note If you use another approach to remotely build your website, for instance with GitLab, please consider opening an issue discussing how to adapt the GitHub-specific instructions. It should be fairly similar.

Overhead

In the table below we list the time taken from starting a GA deployment to displaying a meaningful plot.

  • Time 1 is effectively the time to first plot i.e. the time it takes to run a simple code cell that plots something meaningful,
  • Time 2 is a total build time including the set up of dependencies with GA on a simple page that runs and shows the plot.

Note that the exact time you get in your case will depend on GA and so you should take these numbers as indicators rather than an exact figure.

Package Example ΔT1 (sec) ΔT2 (min)
CairoMakie.jl ➡️
Gadfly.jl ➡️
Gaston.jl ➡️
PGFPlots.jl ➡️
PGFPlotsX.jl ➡️
Plots.jl (GR) ➡️
PyPlot.jl ➡️
UnicodePlots.jl ➡️
WGLMakie.jl ➡️

Lastly, note that if the pages on which you have plots don't change and that you use the cache, these pages will be skipped at build time and you won't have to pay the full overhead (only the installation of the dependencies but that's always under 1 min).

Examples

CairoMakie

Failed to retrieve results for plotting lib: 'Cairomakie'.

Gadfly

Failed to retrieve results for plotting lib: 'Gadfly'.

Gaston

Failed to retrieve results for plotting lib: 'Gaston'.

PGFPlots

Failed to retrieve results for plotting lib: 'Pgfplots'.

PGFPlotsX

Failed to retrieve results for plotting lib: 'Pgfplotsx'.

Plots

Failed to retrieve results for plotting lib: 'Plots'.

PyPlot

Failed to retrieve results for plotting lib: 'Pyplot'.

UnicodePlots

Failed to retrieve results for plotting lib: 'Unicodeplots'.

WGLMakie

Failed to retrieve results for plotting lib: 'Wglmakie'.
Website built with Franklin.jl and the Julia programming language.