A Makie theme. And some cool utilities.
using CairoMakie
using Foresight
foresight() |> Makie.set_theme!
fig = Foresight.demofigure()Any combination of the keywords below can be used to customise the theme.
foresight(:dark, :transparent) |> Makie.set_theme!
fig = Foresight.demofigure()foresight(:dark, :transparent) |> Makie.set_theme!
fig = Foresight.demofigure()foresight(:serif) |> Makie.set_theme!
fig = Foresight.demofigure()foresight(:physics) |> Makie.set_theme!
fig = Foresight.demofigure()Add labels to a provided grid layout, automatically searching for blocks to label.
f = Foresight.demofigure()
addlabels!(f)
display(f)Converts a color gradient into a transparent version.
C = cgrad(:viridis)
transparent_gradient = seethrough(C)Generate string representation of a number in scientific notation with a specified number of significant digits.
scientific(1/123.456, 3) # "8.10 ร 10โปยณ"There is also an lscientific method, which returns a LaTeX string:
lscientific(1/123.456, 3) # "8.10 \\times 10^{-3}"Brighten a color by a given factor by blending it with white:
brighten(:cornflowerblue, 0.2) # Brightens the color by 20%Or, darken a color by blending it with black:
darken(:cornflowerblue, 0.2) # Darkens the color by 20%Slightly widens an interval by a fraction ฮด.
x = (0.0, 1.0)
wider_interval = Foresight.widen(x, 0.1)Freezes the axis limits of a Makie figure.
fig, ax, plt = scatter(rand(10), rand(10))
freeze!(ax)Copies a Makie figure to the clipboard.
fig = Figure()
scatter!(fig[1, 1], rand(10), rand(10))
clip(fig)Imports all symbols from a module into the current scope. Use with caution.
@importall(Foresight) .|> evalHides the x-axis or y-axis, respectively, of a given axis object.
fig, ax, plt = scatter(rand(10), rand(10))
hidexaxis!(ax)
hideyaxis!(ax)Displays a CairoMakie scene, axis, figure, or FigureAxisPlot in a new GTK window. If Gtk is loaded, this is the default display method for CairoMakie figures. Useful for X-forwarding CairoMakie outputs from e.g. a remote cluster.
using CairoMakie, Gtk
using Foresight
scene = CairoMakie.Scene()
gtkshow(scene)The theme is based on the colors [cornflowerblue, crimson, cucumber, california, juliapurple]:
It also provides the following colormaps:
The following recipes are exported:
A transparent stepped histogram, shown in the demo figure above.
A transparent kernel density plot, shown in the demo figure above.
Colors a positive definite matrix according to its eigendecomposition.







