Foresight

Documentation for Foresight.

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)")
source
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)
source
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)
source
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)
source
Foresight.foresightMethod
foresight(options...; font=foresightfont())

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.
source
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)
source
Foresight.importallMethod
importall(module)

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

Example

importall(module) .|> eval
source
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}"
source
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
source
Foresight.scientificFunction
scientific(x::Real, sigdigits=2)

Return a 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.

Returns

A string representation of the number in scientific notation with the specified number of significant digits.

Example

scientific(1/123.456, 3) # "8.10 × 10⁻³"
source
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)
source
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())
source