Foresight.jl

A Makie theme
Author brendanjohnharris
Popularity
4 Stars
Updated Last
12 Months Ago
Started In
November 2022

Foresight.jl

Stable Dev Build Status Coverage

A Makie theme. And some cool utilities.

Usage

using CairMakie
using Foresight
foresight() |> Makie.set_theme!
fig = Foresight.demofigure()

demo

Theme options

Any combination of the keywords below can be used to customise the theme.

Dark

foresight(:dark) |> Makie.set_theme!
fig = Foresight.demofigure()

demo

Transparent

foresight(:dark, :transparent) |> Makie.set_theme!
fig = Foresight.demofigure()

demo

Serif

foresight(:serif) |> Makie.set_theme!
fig = Foresight.demofigure()

demo

Utilities

seethrough

Converts a color gradient into a transparent version.

C = cgrad(:viridis)
transparent_gradient = seethrough(C)

widen

Slightly widens an interval by a fraction δ.

x = (0.0, 1.0)
wider_interval = Foresight.widen(x, 0.1)

freeze!

Freezes the axis limits of a Makie figure.

fig, ax, plt = scatter(rand(10), rand(10))
freeze!(ax)

clip

Copies a Makie figure to the clipboard.

fig = Figure()
scatter!(fig[1, 1], rand(10), rand(10))
clip(fig)

@importall

Imports all symbols from a module into the current scope. Use with caution.

@importall(Foresight) .|> eval

hidexaxis! and hideyaxis!

Hides the x-axis or y-axis, respectively, of a given axis object.

fig, ax, plt = scatter(rand(10), rand(10))
hidexaxis!(ax)
hideyaxis!(ax)

gtkshow

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)

Used By Packages

No packages found.