Foresight.addlabels!Function
addlabels!(f::Figure, [text]; dims=2, allowedblocks = [Axis, Axis3, PolarAxis], recurse =
[GridContent, GridLayout], kwargs...)

Add labels to a provided grid layout, automatically searching for blocks to label.

Arguments

  • f: The figure to add labels to.
  • text: Text to be displayed in the labels, as either an interator of strings or a function applied to the integer indices of the grid positions [optional; defaults to (a), (b), ...]
  • dims: The dimension to increment labels; 1 for top-to-bottom increases (column major), or 2 for right-to-left increases (row-major; default).
  • allowedblocks: The types of blocks to consider for labelling (optional; defaults to [Axis, Axis3, PolarAxis]).
  • recurse: The types of blocks to recurse into for searching the allowedblocks (optional; defaults to [GridContent, GridLayout]).
  • kwargs: Keyword arguments to be passed to the Label function.

Examples

f = Foresight.demofigure()
addlabels!(f)
display(f)

See also: addlabels!

Foresight.addlabels!Function
addlabels!(gridpositions, f::Figure, [text]; dims=2, kwargs...)

Add labels to a provided grid layout. The labels are incremented in the linear order of the grid positions.

Arguments

  • gridpositions: An iterator of GridPositions as produced by e.g. subdivide.
  • f: The figure associated with the grid positions (optional)
  • text: Text to be displayed in the labels, as either an interator of strings or a function applied to the integer indices of the grid positions [optional; defaults to (a), (b), ...]
  • kwargs: Keyword arguments to be passed to the Label function.

Examples

f = Figure()
gps = subdivide(f, 2, 2)
addlabels!(gps)
display(f)
Foresight.axiscolorbarMethod
axiscolorbar(ax, args...; kwargs...)

Create a colorbar for the given ax axis. The args argument is passed to the Colorbar constructor, and the kwargs argument is passed to the Colorbar constructor as keyword arguments. The position argument specifies the position of the colorbar relative to the axis, and can be one of :rt (right-top), :rb (right-bottom), :lt (left-top), :lb (left-bottom). The default value is :rt.

Example

f = Figure()
ax = Axis(f[1, 1])
x = -5:0.01:5
p = plot!(ax, x, x->sinc(x), color=1:length(x), colormap=sunset)
axiscolorbar(ax, p; label="Time (m)")
Foresight.brightenMethod
brighten(c::T, β)

Brighten a color c by a factor of β by blending it with white. β should be between 0 and 1.

Example

brighten(cornflowerblue, 0.5)
Foresight.clipFunction
tmpfile = clip(fig=Makie.current_figure(), fmt=:png; kwargs...)

Save the current figure to a temporary file and copy it to the clipboard. kwargs are passed to Makie.save.

Example

f = plot(-5:0.01:5, x->sinc(x))
clip(f)
Foresight.darkenMethod
darken(c::T, β)

Darken a color c by a factor of β by blending it with black. β should be between 0 and 1.

Example

darken(cornflowerblue, 0.5)
Foresight.foresightMethod
foresight(options...; fonts=foresightfonts())

Return the default Foresight theme. The options argument can be used to modify the default values, by passing keyword arguments with the names of the attributes to be changed and their new values.

Some vailable options are:

  • :dark: Use a dark background and light text.
  • :transparent: Make the background transparent.
  • :minorgrid: Show minor gridlines.
  • :serif: Use a serif font.
  • :redblue: Use a red-blue colormap.
  • :gray: Use a grayscale colormap.
  • :physics: Set a theme that resembles typical plots in physics journals.
Foresight.freeze!Method
freeze!(ax::Union{Axis, Axis3, Figure}=current_figure())

Freeze the limits of an Axis or Axis3 object at their current values.

Example

ax = Axis();
plot!(ax, -5:0.01:5, x->sinc(x))
freeze!(ax)
Foresight.importallMethod
importall(module)

Return an array of expressions that can be used to import all names from a module.

Example

importall(module) .|> eval
Foresight.lscientificFunction
lscientific(x::Real, sigdigits=2)

Return a string representation of a number in scientific notation with a specified number of significant digits. This is not an L-string.

Example

lscientific(1/123.456, 3) # "8.10 \times 10^{-3}"
Foresight.prismMethod
prism(x, Y; [palette=[:cornflowerblue, :crimson, :cucumber], colormode=:top, verbose=false.])

Color a covariance matrix each element's contribution to each of the top k principal components, where k is the length of the supplied color palette (defaults to the number of principal component weights given). Provide as positional arguments a vector x of N row names and an N×N covariance matrix Y.

Keyword Arguments

  • palette: a vector containing a color for each principal component.
  • colormode: how to color the covariance matrix. :raw gives no coloring by principal components, :top is a combination of the top three PC colors (default) and :all is a combination of all PC colors, where PCN = :black if N > length(palette).
  • verbose: whether to print the feature weights to the console
Foresight.scientificFunction
scientific(x::Real, sigdigits=2)

Generate string representation of a number in scientific notation with a specified number of significant digits.

Arguments

  • x::Real: The number to be formatted.
  • sigdigits::Int=2: The number of significant digits to display.

Example

scientific(1/123.456, 3) # "8.10 × 10⁻³"
Foresight.seethroughFunction
seethrough(C::ContinuousColorGradient, start=0.0, stop=1.0)

Convert a color gradient into a transparent version

Examples

C = sunrise;
transparent_gradient = seethrough(C)
Foresight.@default_theme!Macro
@default_theme!(thm)

Set the default theme to thm and save it as a preference. The change will take effect after restarting Julia.

Example

    @default_theme!(foresight())