What's exported

AbstractPlotting.AbsoluteType
Absolute

Force transformation to be absolute, not relative to the current state. This is the default setting.

AbstractPlotting.PlotSpecType

PlotSpec{P<:AbstractPlot}(args...; kwargs...)

Object encoding positional arguments (args), a NamedTuple of attributes (kwargs) as well as plot type P of a basic plot.

AbstractPlotting.SceneType

TODO document this

Fields

  • parent

  • events

  • px_area

  • camera

  • camera_controls

  • data_limits

  • transformation

  • plots

  • theme

  • attributes

  • children

  • current_screens

  • updated

Constructors

AbstractPlotting.StepperType
Stepper(scene, path; format = :jpg)

Creates a Stepper for generating progressive plot examples.

Each "step" is saved as a separate file in the folder pointed to by path, and the format is customizable by format, which can be any output type your backend supports.

AbstractPlotting.TransformationType

Holds the transformations for Scenes.

Fields

  • parent::Base.RefValue{AbstractPlotting.Transformable}

  • translation::Observables.Observable{Vec{3,Float32}}

  • scale::Observables.Observable{Vec{3,Float32}}

  • rotation::Observables.Observable{Quaternion{Float32}}

  • model::Observables.Observable{StaticArrays.SArray{Tuple{4,4},Float32,2,16}}

  • flip::Observables.Observable{Tuple{Bool,Bool,Bool}}

  • align::Observables.Observable{Vec{2,Float32}}

  • data_func::Observables.Observable{Any}

AbstractPlotting.FRectMethod
FRect(x, y, w, h)

Creates a two dimensional rectangle, at origin (x, y) and with width w and height h. Formally defined as the Cartesian product of the intervals (x, y) and (w, h).

AbstractPlotting.IRectMethod
IRect(x, y, w, h)

Creates a two dimensional rectangle of integer dimensions, at origin (x, y) and with width w and height h

AbstractPlotting.IRectMethod
IRect(x, y, wh::VecTypes)

Creates a two dimensional rectangle of integer dimensions, with origin at (x, y), and with width and height as the respective components of vector wh

AbstractPlotting.IRectMethod
IRect(xy::NamedTuple{(:x, :y)}, wh::NamedTuple{(:width, :height)})

This takes two named tuples and constructs an integer valued rectangle with them.

AbstractPlotting.IRectMethod
IRect(xy::VecTypes, w, h)

Creates a two dimensional rectangle of integer dimensions, with origin at vector xy, and with width w and height h

AbstractPlotting.IRectMethod
IRect(xy::VecTypes, wh::VecTypes)

Creates a two dimensional rectangle of integer dimensions, with origin at vector xy, and with width and height as the respective components of vector wh

AbstractPlotting.annotations!Method
`annotations(strings::Vector{String}, positions::Vector{Point})`

Plots an array of texts at each position in positions.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.annotations!,T} where T are:

source
AbstractPlotting.annotationsMethod
`annotations(strings::Vector{String}, positions::Vector{Point})`

Plots an array of texts at each position in positions.

Theme

Available attributes and their defaults for Annotations{...} are:

  align           (:left, :bottom)
  alpha           1.0
  color           :black
  font            "Dejavu Sans"
  linewidth       1
  overdraw        false
  position        Float32[0.0, 0.0]
  rotation        0.0
  strokecolor     (:black, 0.0)
  strokewidth     0
  textsize        20
  transparency    false
  visible         true
source
AbstractPlotting.arc!Method
arc(origin, radius, start_angle, stop_angle; kwargs...)

This function plots a circular arc, centered at origin with radius radius, from start_angle to stop_angle. origin must be a coordinate in 2 dimensions (i.e., a Point2); the rest of the arguments must be <: Number.

Examples:

arc(Point2f0(0), 1, 0.0, π) arc(Point2f0(1, 2), 0.3. π, -π)

Theme

Available attributes and their defaults for Combined{AbstractPlotting.arc!,T} where T are:

source
AbstractPlotting.arcMethod
arc(origin, radius, start_angle, stop_angle; kwargs...)

This function plots a circular arc, centered at origin with radius radius, from start_angle to stop_angle. origin must be a coordinate in 2 dimensions (i.e., a Point2); the rest of the arguments must be <: Number.

Examples:

arc(Point2f0(0), 1, 0.0, π) arc(Point2f0(1, 2), 0.3. π, -π)

Theme

Available attributes and their defaults for Arc{...} are:

  alpha           1.0
  color           :black
  colormap        :viridis
  colorrange      AbstractPlotting.Automatic()
  linestyle       "nothing"
  linewidth       1.0
  overdraw        false
  resolution      361
  transparency    false
  visible         true
source
AbstractPlotting.arrows!Method
`arrows(points, directions; kwargs...)`
`arrows(x, y, u, v)`
`arrows(x::AbstractVector, y::AbstractVector, u::AbstractMatrix, v::AbstractMatrix)`
`arrows(x, y, z, u, v, w)`

Plots arrows at the specified points with the specified components. u and v are interpreted as vector components (u being the x and v being the y), and the vectors are plotted with the tails at x, y.

If x, y, u, v are <: AbstractVector, then each 'row' is plotted as a single vector.

If u, v are <: AbstractMatrix, then x and y are interpreted as specifications for a grid, and u, v are plotted as arrows along the grid.

arrows can also work in three dimensions.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.arrows!,T} where T are:

source
AbstractPlotting.arrowsMethod
`arrows(points, directions; kwargs...)`
`arrows(x, y, u, v)`
`arrows(x::AbstractVector, y::AbstractVector, u::AbstractMatrix, v::AbstractMatrix)`
`arrows(x, y, z, u, v, w)`

Plots arrows at the specified points with the specified components. u and v are interpreted as vector components (u being the x and v being the y), and the vectors are plotted with the tails at x, y.

If x, y, u, v are <: AbstractVector, then each 'row' is plotted as a single vector.

If u, v are <: AbstractMatrix, then x and y are interpreted as specifications for a grid, and u, v are plotted as arrows along the grid.

arrows can also work in three dimensions.

Theme

Available attributes and their defaults for Arrows{...} are:

  arrowcolor   :black
  arrowhead    AbstractPlotting.Automatic()
  arrowsize    0.3
  arrowtail    "nothing"
  lengthscale  1.0f0
  linecolor    :black
  linestyle    "nothing"
  linewidth    1
  normalize    false
  scale        Float32[1.0, 1.0, 1.0]
source
AbstractPlotting.axis2d!Method
axis2d!(args; attributes...)

Plots a 2-dimensional axis.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.axis2d!,T} where T are:

source
AbstractPlotting.axis2dMethod
axis2d(args; attributes...)

Plots a 2-dimensional axis.

Theme

Axis attributes and their defaults for Axis2D{...} are:

    showgrid: true
    padding: 0.1
    grid: 
        linestyle: (nothing, nothing)
        linewidth: (0.5, 0.5)
        linecolor: ((:black, 0.3), (:black, 0.3))
    visible: true
    ticks: 
        linecolor: ((:black, 0.4), (:black, 0.4))
        linestyle: (nothing, nothing)
        font: ("Dejavu Sans", "Dejavu Sans")
        formatter: plain
        align: ((:center, :top), (:right, :center))
        textsize: (5, 5)
        rotation: (0.0, 0.0)
        textcolor: (:black, :black)
        gap: 3
        title_gap: 3
        ranges_labels: (AbstractPlotting.Automatic(), AbstractPlotting.Automatic())
        linewidth: (1, 1)
    frame: 
        axis_position: nothing
        linestyle: nothing
        linewidth: 1.0
        arrow_size: 2.5
        axis_arrow: false
        linecolor: black
        frames: ((false, false), (false, false))
    names: 
        axisnames: ("x", "y")
        rotation: (0.0, -4.71238898038469)
        font: ("Dejavu Sans", "Dejavu Sans")
        title: nothing
        textcolor: (:black, :black)
        align: ((:center, :top), (:center, :bottom))
        textsize: (6, 6)
    showticks: true
source
AbstractPlotting.axis3d!Method
axis3d!(args; attributes...)

Plots a 3-dimensional Axis.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.axis3d!,T} where T are:

source
AbstractPlotting.axis3dMethod
axis3d(args; attributes...)

Plots a 3-dimensional Axis.

Theme

Axis attributes and their defaults for Axis3D{...} are:

    showaxis: (true, true, true)
    showgrid: (true, true, true)
    padding: 0.1
    visible: true
    ticks: 
        rotation: (-0.7071067811865475 + -0.0im + -0.0jm - 0.7071067811865476km, -4.371139e-8 + 0.0im + 0.0jm + 1.0km, -3.090861907263062e-8 + 3.090861907263061e-8im + 0.7071067811865475jm + 0.7071067811865476km)
        font: ("Dejavu Sans", "Dejavu Sans", "Dejavu Sans")
        ranges_labels: (AbstractPlotting.Automatic(), AbstractPlotting.Automatic())
        formatter: plain
        textcolor: (RGBA{Float32}(0.5f0,0.5f0,0.5f0,0.6f0), RGBA{Float32}(0.5f0,0.5f0,0.5f0,0.6f0), RGBA{Float32}(0.5f0,0.5f0,0.5f0,0.6f0))
        align: ((:left, :center), (:right, :center), (:right, :center))
        textsize: (5, 5, 5)
        gap: 1
    frame: 
        axiscolor: (:black, :black, :black)
        linewidth: (1, 1, 1)
        linecolor: (RGBA{Float32}(0.5f0,0.5f0,0.5f0,0.4f0), RGBA{Float32}(0.5f0,0.5f0,0.5f0,0.4f0), RGBA{Float32}(0.5f0,0.5f0,0.5f0,0.4f0))
    names: 
        axisnames: ("x", "y", "z")
        rotation: (-0.7071067811865475 + -0.0im + -0.0jm - 0.7071067811865476km, -4.371139e-8 + 0.0im + 0.0jm + 1.0km, -3.090861907263062e-8 + 3.090861907263061e-8im + 0.7071067811865475jm + 0.7071067811865476km)
        font: ("Dejavu Sans", "Dejavu Sans", "Dejavu Sans")
        textcolor: (:black, :black, :black)
        align: ((:left, :center), (:right, :center), (:right, :center))
        textsize: (6.0, 6.0, 6.0)
        gap: 1
    showticks: (true, true, true)
    scale: Float32[1.0, 1.0, 1.0]
source
AbstractPlotting.band!Method
band(x, ylower, yupper; kwargs...)

Plots a band from ylower to yupper along x.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.band!,T} where T are:

source
AbstractPlotting.bandMethod
band(x, ylower, yupper; kwargs...)

Plots a band from ylower to yupper along x.

Theme

Available attributes and their defaults for Band{...} are:

  alpha           1.0
  color           RGBA{Float32}(1.0f0,0.0f0,0.0f0,0.2f0)
  colormap        :viridis
  colorrange      AbstractPlotting.Automatic()
  interpolate     false
  linewidth       1
  overdraw        false
  shading         true
  transparency    false
  visible         true
source
AbstractPlotting.barplot!Method
barplot(x, y; kwargs...)

Plots a barplot; y defines the height. x and y should be 1 dimensional.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.barplot!,T} where T are:

source
AbstractPlotting.barplotMethod
barplot(x, y; kwargs...)

Plots a barplot; y defines the height. x and y should be 1 dimensional.

Theme

Available attributes and their defaults for BarPlot{...} are:

  color        :black
  colormap     :viridis
  colorrange   AbstractPlotting.Automatic()
  fillto       0.0
  marker       GeometryTypes.HyperRectangle
  strokecolor  :white
  strokewidth  0
  width        AbstractPlotting.Automatic()
source
AbstractPlotting.button!Method
button(text)

Creates a button which can be clicked. On click, the button increments its clicks field by one.

For example:

scene = button("click me please")
lift(scene[end].clicks) do clicks
    # your function here
end

Theme

Available attributes and their defaults for Combined{AbstractPlotting.button!,T} where T are:

source
AbstractPlotting.buttonMethod
button(text)

Creates a button which can be clicked. On click, the button increments its clicks field by one.

For example:

scene = button("click me please")
lift(scene[end].clicks) do clicks
    # your function here
end

Theme

Available attributes and their defaults for Button{...} are:

  backgroundcolor  (:white, 0.4)
  camera           AbstractPlotting.campixel!
  clicks           0
  dimensions       (40, 40)
  padvalue         0.15
  position         (10, 10)
  raw              true
  strokecolor      (:black, 0.4)
  strokewidth      1
  textcolor        :black
  textsize         20
source
AbstractPlotting.cam3d_cad!Method
cam3d_cad!(scene; kw_args...)

Creates a 3D camera for scene which rotates around the viewer's "up" axis - similarly to how it's done in CAD software cameras.

AbstractPlotting.colorlegend!Method
colorlegend(colormap, range)
colorlegend(plot::Plot)

Creates a colorbar from the given colormap or range, or from the Attributes of the given Plot.

Theme

Available attributes and their defaults for ColorLegend{...} are:

align (:left, :hcenter) backgroundcolor :white camera AbstractPlotting.campixel! font "Dejavu Sans" formatter AbstractPlotting.Formatters.plain labels AbstractPlotting.Automatic() outerpadding 10 padding 10 position (1, 1) ranges AbstractPlotting.Automatic() raw true rotation 0.0 strokecolor RGBA{Float64}(0.3,0.3,0.3,0.9) strokewidth 0.3 textcolor :black textgap 15 textsize 16 width (20, <the height of the scene> - 10)

source
AbstractPlotting.colorlegendMethod
colorlegend(colormap, range)
colorlegend(plot::Plot)

Creates a colorbar from the given colormap or range, or from the Attributes of the given Plot.

Theme

Available attributes and their defaults for ColorLegend{...} are:

align (:left, :hcenter) backgroundcolor :white camera AbstractPlotting.campixel! font "Dejavu Sans" formatter AbstractPlotting.Formatters.plain labels AbstractPlotting.Automatic() outerpadding 10 padding 10 position (1, 1) ranges AbstractPlotting.Automatic() raw true rotation 0.0 strokecolor RGBA{Float64}(0.3,0.3,0.3,0.9) strokewidth 0.3 textcolor :black textgap 15 textsize 16 width (20, <the height of the scene> - 10)

source
AbstractPlotting.contour!Method
contour(x, y, z)

Creates a contour plot of the plane spanning x::Vector, y::Vector, z::Matrix

Theme

Available attributes and their defaults for Combined{AbstractPlotting.contour!,T} where T are:

source
AbstractPlotting.contourMethod
contour(x, y, z)

Creates a contour plot of the plane spanning x::Vector, y::Vector, z::Matrix

Theme

Available attributes and their defaults for Contour{...} are:

  alpha           1.0
  color           "nothing"
  colormap        :viridis
  colorrange      AbstractPlotting.Automatic()
  fillrange       false
  levels          5
  linewidth       1.0
  overdraw        false
  transparency    false
  visible         true
source
AbstractPlotting.contour3d!Method
contour3d(x, y, z)

Creates a 3D contour plot of the plane spanning x::Vector, y::Vector, z::Matrix, with z-elevation for each level.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.contour3d!,T} where T are:

source
AbstractPlotting.contour3dMethod
contour3d(x, y, z)

Creates a 3D contour plot of the plane spanning x::Vector, y::Vector, z::Matrix, with z-elevation for each level.

Theme

Available attributes and their defaults for Contour3d{...} are:

  alpha           1.0
  color           "nothing"
  colormap        :viridis
  colorrange      AbstractPlotting.Automatic()
  fillrange       false
  levels          5
  linewidth       1.0
  overdraw        false
  transparency    false
  visible         true
source
AbstractPlotting.convert_argumentsMethod
convert_arguments(P, x, y, z)::(Vector)

Takes vectors x, y, and z and turns it into a vector of 3D points of the values from x, y, and z. P is the plot Type (it is optional).

AbstractPlotting.convert_argumentsMethod
convert_arguments(P, x, y)::(Vector)

Takes vectors x and y and turns it into a vector of 2D points of the values from x and y.

P is the plot Type (it is optional).

AbstractPlotting.convert_argumentsMethod
convert_arguments(P, y)::Vector

Takes vector y and generates a range from 1 to the length of y, for plotting on an arbitrary x axis.

P is the plot Type (it is optional).

AbstractPlotting.convert_argumentsMethod
convert_arguments(P, x)::(Vector)

Takes an input GeometryPrimitive x and decomposes it to points. P is the plot Type (it is optional).

AbstractPlotting.convert_argumentsMethod
convert_arguments(P, x)::(Vector)

Takes an input HyperRectangle x and decomposes it to points.

P is the plot Type (it is optional).

AbstractPlotting.convert_argumentsMethod
convert_arguments(P, Matrix)::Tuple{ClosedInterval, ClosedInterval, Matrix}

Takes an AbstractMatrix, converts the dimesions n and m into ClosedInterval, and stores the ClosedInterval to n and m, plus the original matrix in a Tuple.

P is the plot Type (it is optional).

AbstractPlotting.convert_argumentsMethod
convert_arguments(P, x, y, z)::Tuple{ClosedInterval, ClosedInterval, Matrix}

Takes 2 ClosedIntervals's x, y, and an AbstractMatrix z, and converts the closed range to linspaces with size(z, 1/2) P is the plot Type (it is optional).

AbstractPlotting.convert_argumentsMethod
convert_arguments(P, x::VecOrMat, y::VecOrMat, z::Matrix)

Takes 3 AbstractMatrix x, y, and z, converts them to Float32 and outputs them in a Tuple.

P is the plot Type (it is optional).

AbstractPlotting.convert_argumentsMethod
convert_arguments(P, x, y, z, f)::(Vector, Vector, Vector, Matrix)

Takes AbstractVector x, y, and z and the function f, evaluates f on the volume spanned by x, y and z, and puts x, y, z and f(x,y,z) in a Tuple.

P is the plot Type (it is optional).

AbstractPlotting.convert_argumentsMethod
convert_arguments(Mesh, x, y, z, indices)::GLNormalMesh

Takes real vectors x, y, z and constructs a triangle mesh out of those, using the faces in indices, which can be integers (every 3 -> one triangle), or GeometryTypes.Face{N, <: Integer}.

AbstractPlotting.convert_argumentsMethod
convert_arguments(Mesh, x, y, z)::GLNormalMesh

Takes real vectors x, y, z and constructs a mesh out of those, under the assumption that every 3 points form a triangle.

AbstractPlotting.convert_argumentsMethod
convert_arguments(Mesh, xyz::AbstractVector)::GLNormalMesh

Takes an input mesh and a vector xyz representing the vertices of the mesh, and creates indices under the assumption, that each triplet in xyz forms a triangle.

AbstractPlotting.convert_argumentsMethod
convert_arguments(P, x, y, f)::(Vector, Vector, Matrix)

Takes vectors x and y and the function f, and applies f on the grid that x and y span. This is equivalent to f.(x, y'). P is the plot Type (it is optional).

AbstractPlotting.convert_argumentsMethod
convert_arguments(P, x, y, z, i)::(Vector, Vector, Vector, Matrix)

Takes 3 AbstractVector x, y, and z and the AbstractMatrix i, and puts everything in a Tuple.

P is the plot Type (it is optional).

AbstractPlotting.convert_argumentsMethod
convert_arguments(P, Matrix)::Tuple{ClosedInterval, ClosedInterval, ClosedInterval, Matrix}

Takes an array of {T, 3} where T, converts the dimesions n, m and k into ClosedInterval, and stores the ClosedInterval to n, m and k, plus the original array in a Tuple.

P is the plot Type (it is optional).

AbstractPlotting.convert_attributeFunction

A Symbol/String naming the gradient. For more on what names are available please see: available_gradients(). For now, we support gradients from PlotUtils natively.

AbstractPlotting.convert_attributeMethod
`AbstractVector{<:AbstractFloat}` for denoting sequences of fill/nofill. e.g.

[0.5, 0.8, 1.2] will result in 0.5 filled, 0.3 unfilled, 0.4 filled. 1.0 unit is one linewidth!

AbstractPlotting.fill_between!Method
fill_between!(x, y1, y2; where = nothing, scene = current_scene(), kw_args...)

fill the section between 2 lines with the condition where

AbstractPlotting.hboxMethod
hbox(scenes...; parent = Scene(clear = false), kwargs...)

Attach the given Scenes together on the horizontal axis. For example, two Scenes hboxed will be placed one on top of the other.



– Scene 1 –





– Scene 2 –



AbstractPlotting.heatmap!Method
heatmap(x, y, values)
heatmap(values)

Plots a heatmap as an image on x, y (defaults to interpretation as dimensions).

Theme

Available attributes and their defaults for Combined{AbstractPlotting.heatmap!,T} where T are:

source
AbstractPlotting.heatmapMethod
heatmap(x, y, values)
heatmap(values)

Plots a heatmap as an image on x, y (defaults to interpretation as dimensions).

Theme

Available attributes and their defaults for Heatmap{...} are:

  alpha           1.0
  color           :black
  colormap        :viridis
  colorrange      AbstractPlotting.Automatic()
  interpolate     false
  levels          1
  linewidth       0.0
  overdraw        false
  transparency    false
  visible         true
source
AbstractPlotting.helpMethod
help(func[; extended = false])

Welcome to the main help function of Makie.jl / AbstractPlotting.jl.

For help on a specific function's arguments, type help_arguments(function_name).

For help on a specific function's attributes, type help_attributes(plot_Type).

Use the optional extended = true keyword argument to see more details.

AbstractPlotting.help_attributesMethod
help_attributes([io], Union{PlotType, PlotFunction}; extended = false)

Returns a list of attributes for the plot type Typ. The attributes returned extend those attributes found in the default_theme.

Use the optional keyword argument extended (default = false) to show in addition the default values of each attribute. usage:

>help_attributes(scatter)
	alpha
	color
	colormap
	colorrange
	distancefield
	glowcolor
	glowwidth
	linewidth
	marker
	marker_offset
	markersize
	overdraw
	rotations
	strokecolor
	strokewidth
	transform_marker
	transparency
	uv_offset_width
	visible
AbstractPlotting.hovered_sceneMethod
hovered_scene()

Return the scene that the mouse is currently hovering over.

Properly identifies the scene for a plot with multiple sub-plots.

AbstractPlotting.image!Method
image(x, y, image)
image(image)

Plots an image on range x, y (defaults to dimensions).

Theme

Available attributes and their defaults for Combined{AbstractPlotting.image!,T} where T are:

source
AbstractPlotting.imageMethod
image(x, y, image)
image(image)

Plots an image on range x, y (defaults to dimensions).

Theme

Available attributes and their defaults for Image{...} are:

  alpha           1.0
  color           :black
  colormap        ColorTypes.RGBA{Float32}[RGBA{Float32}(0.0f0,0.0f0,0.0f0,1.0f0), RGBA{Float32}(1.0f0,1.0f0,1.0f0,1.0f0)]
  colorrange      AbstractPlotting.Automatic()
  linewidth       1
  overdraw        false
  transparency    false
  visible         true
source
AbstractPlotting.ispressedMethod

returns true if button is pressed in scene[:mousebuttons or :keyboardbuttons] You can use nothing, to indicate it should always return true

AbstractPlotting.legend!Method
`legend(plots, labels; kwargs...)`

Plots a legend for the given plots with the given labels. plots may be a single Plot or a list of Plots.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.legend!,T} where T are:

source
AbstractPlotting.legendMethod
`legend(plots, labels; kwargs...)`

Plots a legend for the given plots with the given labels. plots may be a single Plot or a list of Plots.

Theme

Available attributes and their defaults for Legend{...} are:

  align            (:left, :center)
  backgroundcolor  :white
  camera           AbstractPlotting.campixel!
  font             "Dejavu Sans"
  gap              20
  labelwidth       20
  linepattern      Point{2,Float32}[[0.0, 0.0], [1.0, 0.0]]
  markersize       5
  outer_area       GeometryTypes.HyperRectangle{2,Int64}([0, 0], [1, 1])
  outerpadding     10
  padding          10
  position         (1, 1)
  raw              true
  rotation         1.0 + 0.0im + 0.0jm + 0.0km
  scatterpattern   Point{2,Float32}[[0.5, 0.0]]
  strokecolor      RGBA{Float64}(0.3,0.3,0.3,0.9)
  strokewidth      1
  textcolor        :black
  textgap          15
  textsize         16
source
AbstractPlotting.lines!Method
lines(positions)
lines(x, y)
lines(x, y, z)

Creates a connected line plot for each element in (x, y, z), (x, y) or positions.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.lines!,T} where T are:

source
AbstractPlotting.linesMethod
lines(positions)
lines(x, y)
lines(x, y, z)

Creates a connected line plot for each element in (x, y, z), (x, y) or positions.

Theme

Available attributes and their defaults for Lines{...} are:

  alpha           1.0
  color           :black
  colormap        :viridis
  colorrange      AbstractPlotting.Automatic()
  linestyle       "nothing"
  linewidth       1.0
  overdraw        false
  transparency    false
  visible         true
source
AbstractPlotting.linesegments!Method
linesegments(positions)
linesegments(x, y)
linesegments(x, y, z)

Plots a line for each pair of points in (x, y, z), (x, y), or positions.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.linesegments!,T} where T are:

source
AbstractPlotting.linesegmentsMethod
linesegments(positions)
linesegments(x, y)
linesegments(x, y, z)

Plots a line for each pair of points in (x, y, z), (x, y), or positions.

Theme

Available attributes and their defaults for LineSegments{...} are:

  alpha           1.0
  color           :black
  colormap        :viridis
  colorrange      AbstractPlotting.Automatic()
  linestyle       "nothing"
  linewidth       1.0
  overdraw        false
  transparency    false
  visible         true
source
AbstractPlotting.map_onceMethod
map_once(closure, inputs::Node....)::Node

Like Reactive.foreach, in the sense that it will be preserved even if no reference is kept. The difference is, that you can call map once multiple times with the same closure and it will close the old result Node and register a new one instead.

``` function test(s1::Node) s3 = maponce(x-> (println("1 ", x); x), s1) s3 = maponce(x-> (println("2 ", x); x), s1)

end test(Node(1), Node(2))

AbstractPlotting.mesh!Method
mesh(x, y, z)
mesh(mesh_object)
mesh(x, y, z, faces)
mesh(xyz, faces)

Plots a 3D mesh.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.mesh!,T} where T are:

source
AbstractPlotting.meshMethod
mesh(x, y, z)
mesh(mesh_object)
mesh(x, y, z, faces)
mesh(xyz, faces)

Plots a 3D mesh.

Theme

Available attributes and their defaults for Mesh{...} are:

  alpha           1.0
  color           :black
  colormap        :viridis
  colorrange      AbstractPlotting.Automatic()
  interpolate     false
  linewidth       1
  overdraw        false
  shading         true
  transparency    false
  visible         true
source
AbstractPlotting.meshscatter!Method
meshscatter(positions)
meshscatter(x, y)
meshscatter(x, y, z)

Plots a mesh for each element in (x, y, z), (x, y), or positions (similar to scatter). markersize is a scaling applied to the primitive passed as marker.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.meshscatter!,T} where T are:

source
AbstractPlotting.meshscatterMethod
meshscatter(positions)
meshscatter(x, y)
meshscatter(x, y, z)

Plots a mesh for each element in (x, y, z), (x, y), or positions (similar to scatter). markersize is a scaling applied to the primitive passed as marker.

Theme

Available attributes and their defaults for MeshScatter{...} are:

  alpha           1.0
  color           :black
  colormap        :viridis
  colorrange      AbstractPlotting.Automatic()
  linewidth       1
  marker          GeometryTypes.HyperSphere{3,Float32}(Float32[0.0, 0.0, 0.0], 1.0f0)
  markersize      0.1
  overdraw        false
  rotations       1.0 + 0.0im + 0.0jm + 0.0km
  shading         true
  transparency    false
  visible         true
source
AbstractPlotting.mouseoverMethod
mouseover(scene::SceneLike, plots::AbstractPlot...)

Returns true if the mouse currently hovers any of plots.

AbstractPlotting.mousepositionFunction
mouseposition(scene = hovered_scene()) -> pos

Return the current position of the mouse pos in data points of the given scene.

By default uses the scene that the mouse is currently hovering over.

AbstractPlotting.move!Method
move!(slider::Slider, idx::Integer)

Moves the slider to the position of slider.range[idx].

AbstractPlotting.onpickFunction
onpick(func, plot)

Calls func if one clicks on plot. Implemented by the backend.

AbstractPlotting.onpickMethod
onpick(f, scene::SceneLike, plots::AbstractPlot...)

Calls f(idx) whenever the mouse is over any of plots. idx is an index, e.g. when over a scatter plot, it will be the index of the hovered element

AbstractPlotting.poly!Method
`poly(vertices, indices; kwargs...)`
`poly(points; kwargs...)`
`poly(shape; kwargs...)`

Plots a polygon based on the arguments given. When vertices and indices are given, it functions similarly to mesh. When points are given, it draws one polygon that connects all the points in order. When a shape is given (essentially anything decomposable by GeometryTypes), it will plot decompose(shape).

poly(coordinates, connectivity; kwargs...)

Plots polygons, which are defined by coordinates (the coordinates of the vertices) and connectivity (the edges between the vertices).

Theme

Available attributes and their defaults for Combined{AbstractPlotting.poly!,T} where T are:

source
AbstractPlotting.polyMethod
`poly(vertices, indices; kwargs...)`
`poly(points; kwargs...)`
`poly(shape; kwargs...)`

Plots a polygon based on the arguments given. When vertices and indices are given, it functions similarly to mesh. When points are given, it draws one polygon that connects all the points in order. When a shape is given (essentially anything decomposable by GeometryTypes), it will plot decompose(shape).

poly(coordinates, connectivity; kwargs...)

Plots polygons, which are defined by coordinates (the coordinates of the vertices) and connectivity (the edges between the vertices).

Theme

Available attributes and their defaults for Poly{...} are:

  color         :black
  colormap      :viridis
  colorrange    AbstractPlotting.Automatic()
  linestyle     "nothing"
  overdraw      false
  shading       false
  strokecolor   RGBA{Float32}(0.0f0,0.0f0,0.0f0,0.0f0)
  strokewidth   0.0
  transparency  false
  visible       true
source
AbstractPlotting.recordMethod
record(func, scene, path, iter; framerate = 24)

This is simply a shorthand to wrap a for loop in record.

Example:

    scene = lines(rand(10))
    record(scene, "test.gif", 1:100) do i
        scene.plots[:color] = Colors.RGB(i/255, 0, 0) # animate scene
    end
AbstractPlotting.recordMethod
record(func, scene, path; framerate = 24)
record(func, scene, path, iter; framerate = 24)

Records the Scene scene after the application of func on it for each element in itr (any iterator). func must accept an element of itr.

The animation is then saved to path, with the format determined by path's extension. Allowable extensions are:

  • .mkv (the default, doesn't need to convert)
  • .mp4 (good for Web, most supported format)
  • .webm (smallest file size)
  • .gif (largest file size for the same quality)

.mp4 and .mk4 are marginally bigger and .gifs are up to 6 times bigger with the same quality!

Typical usage patterns would look like:

record(scene, "video.mp4", itr) do i
    func(i) # or some other manipulation of the Scene
end

or, for more tweakability,

record(scene, "test.gif") do io
    for i = 1:100
        func!(scene)     # animate scene
        recordframe!(io) # record a new frame
    end
end

If you want a more tweakable interface, consider using VideoStream and save.

Examples

scene = lines(rand(10))
record(scene, "test.gif") do io
    for i in 1:255
        scene.plots[:color] = Colors.RGB(i/255, (255 - i)/255, 0) # animate scene
        recordframe!(io)
    end
end

or

scene = lines(rand(10))
record(scene, "test.gif", 1:255) do i
    scene.plots[:color] = Colors.RGB(i/255, (255 - i)/255, 0) # animate scene
end
AbstractPlotting.record_eventsMethod
record_events(f, scene::Scene, path::String)

Records all window events that happen while executing function f for scene and serializes them to path.

AbstractPlotting.replay_eventsMethod
replay_events(f, scene::Scene, path::String)
replay_events(scene::Scene, path::String)

Replays the serialized events recorded with record_events in path in scene.

AbstractPlotting.rotate!Method
rotate!(scene::Transformable, axis_rot::Quaternion)
rotate!(scene::Transformable, axis_rot::AbstractFloat)
rotate!(scene::Transformable, axis_rot...)

Apply an absolute rotation to the Scene. Rotations are all internally converted to Quaternions.

AbstractPlotting.rotate!Method
rotate!(Accum, scene::Transformable, axis_rot...)

Apply a relative rotation to the Scene, by multiplying by the current rotation.

AbstractPlotting.rotate_cam!Method
rotate_cam!(scene::Scene, theta_v::Number...)
rotate_cam!(scene::Scene, theta_v::VecTypes)

Rotate the camera of the Scene by the given rotation.

AbstractPlotting.scale!Method
scale!(t::Transformable, x, y)
scale!(t::Transformable, x, y, z)
scale!(t::Transformable, xyz)
scale!(t::Transformable, xyz...)

Scale the given Transformable (a Scene or Plot) to the given arguments. Can take x, y or x, y, z. This is an absolute scaling, and there is no option to perform relative scaling.

AbstractPlotting.scatter!Method
scatter(positions)
scatter(x, y)
scatter(x, y, z)

Plots a marker for each element in (x, y, z), (x, y), or positions.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.scatter!,T} where T are:

source
AbstractPlotting.scatterMethod
scatter(positions)
scatter(x, y)
scatter(x, y, z)

Plots a marker for each element in (x, y, z), (x, y), or positions.

Theme

Available attributes and their defaults for Scatter{...} are:

  alpha             1.0
  color             :black
  colormap          :viridis
  colorrange        AbstractPlotting.Automatic()
  distancefield     "nothing"
  glowcolor         RGBA{N0f8}(0.0,0.0,0.0,0.0)
  glowwidth         0.0
  linewidth         1
  marker            GeometryTypes.HyperSphere{2,T} where T
  marker_offset     AbstractPlotting.Automatic()
  markersize        0.1
  overdraw          false
  rotations         Billboard()
  strokecolor       RGBA{N0f8}(0.0,0.0,0.0,0.0)
  strokewidth       0.0
  transform_marker  false
  transparency      false
  uv_offset_width   Float32[0.0, 0.0, 0.0, 0.0]
  visible           true
source
AbstractPlotting.scatterlines!Method
scatterlines(xs, ys, [zs]; kwargs...)

Plots lines between sets of x and y coordinates provided, as well as plotting those points using scatter.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.scatterlines!,T} where T are:

source
AbstractPlotting.scatterlinesMethod
scatterlines(xs, ys, [zs]; kwargs...)

Plots lines between sets of x and y coordinates provided, as well as plotting those points using scatter.

Theme

Available attributes and their defaults for ScatterLines{...} are:

  alpha             1.0
  color             :black
  colormap          :viridis
  colorrange        AbstractPlotting.Automatic()
  distancefield     "nothing"
  glowcolor         RGBA{N0f8}(0.0,0.0,0.0,0.0)
  glowwidth         0.0
  linestyle         "nothing"
  linewidth         1
  marker            GeometryTypes.HyperSphere{2,T} where T
  marker_offset     AbstractPlotting.Automatic()
  markersize        0.1
  overdraw          false
  rotations         Billboard()
  strokecolor       RGBA{N0f8}(0.0,0.0,0.0,0.0)
  strokewidth       0.0
  transform_marker  false
  transparency      false
  uv_offset_width   Float32[0.0, 0.0, 0.0, 0.0]
  visible           true
source
AbstractPlotting.select_rectangleMethod
select_rectangle(scene; kwargs...) -> rect

Interactively select a rectangle on a scene by clicking the left mouse button, dragging and then un-clicking. The function returns an observable rect whose value corresponds to the selected rectangle on the scene. In addition the function plots the selected rectangle on the scene as the user clicks and moves the mouse around. When the button is not clicked any more, the plotted rectangle disappears.

The value of the returned observable is updated only when the user un-clicks (i.e. when the final value of the rectangle has been decided) and only if the rectangle has area > 0.

The kwargs... are propagated into lines! which plots the selected rectangle.

AbstractPlotting.series!Method
Series - ?

TODO add function signatures TODO add description

Theme

Available attributes and their defaults for Combined{AbstractPlotting.series!,T} where T are:

source
AbstractPlotting.seriesMethod
Series - ?

TODO add function signatures TODO add description

Theme

Available attributes and their defaults for Series{...} are:

  seriescolors  :Set1
  seriestype    :lines
source
AbstractPlotting.showgradientsMethod
showgradients(
    cgrads::AbstractVector{Symbol};
    h = 0.0, offset = 0.2, textsize = 0.7,
    resolution = (800, length(cgrads) * 84)
)::Scene

Plots the given colour gradients arranged as horizontal colourbars. If you change the offsets or the font size, you may need to change the resolution.

AbstractPlotting.showlibraryMethod
showlibrary(lib::Symbol)::Scene

Shows all colour gradients in the given library. Returns a Scene with these colour gradients arranged as horizontal colourbars.

AbstractPlotting.slider!Method
slider(range; kwargs...)

Creates a slider which slides through the selected range; sliders are discrete. The Slider's value can be accessed through its value field. For example:

scene = slider(1:10)
lift(scene[end].value) do val
    # your function here
end

Theme

Available attributes and their defaults for Combined{AbstractPlotting.slider!,T} where T are:

source
AbstractPlotting.sliderMethod
slider(range; kwargs...)

Creates a slider which slides through the selected range; sliders are discrete. The Slider's value can be accessed through its value field. For example:

scene = slider(1:10)
lift(scene[end].value) do val
    # your function here
end

Theme

Available attributes and their defaults for Slider{...} are:

  backgroundcolor    (:gray, 0.01)
  buttoncolor        :white
  buttonsize         15
  buttonstroke       1.5
  buttonstrokecolor  :black
  camera             AbstractPlotting.campixel!
  position           (0, 0)
  raw                true
  slidercolor        (:gray, 0.6)
  sliderheight       50
  sliderlength       200
  start              AbstractPlotting.Automatic()
  strokecolor        (:black, 0.4)
  strokewidth        1
  textcolor          :black
  textsize           15
  value              0
  valueprinter       AbstractPlotting.default_printer
source
AbstractPlotting.spy!Method
spy(x::Range, y::Range, z::AbstractSparseArray)

Visualizes big sparse matrices. Usage:

N = 200_000
x = sprand(Float64, N, N, (3(10^6)) / (N*N));
spy(x)
# or if you want to specify the range of x and y:
spy(0..1, 0..1, x)

Theme

Available attributes and their defaults for Combined{AbstractPlotting.spy!,T} where T are:

source
AbstractPlotting.spyMethod
spy(x::Range, y::Range, z::AbstractSparseArray)

Visualizes big sparse matrices. Usage:

N = 200_000
x = sprand(Float64, N, N, (3(10^6)) / (N*N));
spy(x)
# or if you want to specify the range of x and y:
spy(0..1, 0..1, x)

Theme

Available attributes and their defaults for Spy{...} are:

  colormap    :viridis
  colorrange  AbstractPlotting.Automatic()
  framecolor  :black
  framesize   1
  marker      AbstractPlotting.Automatic()
  markersize  AbstractPlotting.Automatic()
source
AbstractPlotting.step!Method
step!(s::Stepper)

steps through a Makie.Stepper and outputs a file with filename filename-step.jpg. This is useful for generating progressive plot examples.

AbstractPlotting.streamlines!Method
StreamLines

TODO add function signatures TODO add descripton

Theme

Available attributes and their defaults for Combined{AbstractPlotting.streamlines!,T} where T are:

source
AbstractPlotting.streamlinesMethod
StreamLines

TODO add function signatures TODO add descripton

Theme

Available attributes and their defaults for StreamLines{...} are:

  color      :black
  h          0.01f0
  linewidth  1
  n          5
source
AbstractPlotting.streamplot!Method
streamplot(f::function, xinterval, yinterval;
    kwargs...)

f must either accept f(::Point) or f(x::Number, y::Number). f must return a Point2.

Example:

using Makie
v(x::Point2{T}) = Point2f0(x[2], 4*x[1])
streamplot(v, -2..2, -2..2)

Theme

Available attributes and their defaults for Combined{AbstractPlotting.streamplot!,T} where T are:

Implementation

See the function streamplot_impl for implementation details.

source
AbstractPlotting.streamplotMethod
streamplot(f::function, xinterval, yinterval;
    kwargs...)

f must either accept f(::Point) or f(x::Number, y::Number). f must return a Point2.

Example:

using Makie
v(x::Point2{T}) = Point2f0(x[2], 4*x[1])
streamplot(v, -2..2, -2..2)

Theme

Available attributes and their defaults for StreamPlot{...} are:

  alpha           1.0
  arrow_size      0.03
  color           :black
  colormap        :viridis
  colorrange      AbstractPlotting.Automatic()
  density         1.0
  gridsize        (32, 32, 32)
  linestyle       "nothing"
  linewidth       1.0
  maxsteps        500
  overdraw        false
  stepsize        0.01
  transparency    false
  visible         true

Implementation

See the function streamplot_impl for implementation details.

source
AbstractPlotting.surface!Method
surface(x, y, z)

Plots a surface, where (x, y) define a grid whose heights are the entries in z.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.surface!,T} where T are:

source
AbstractPlotting.surfaceMethod
surface(x, y, z)

Plots a surface, where (x, y) define a grid whose heights are the entries in z.

Theme

Available attributes and their defaults for Surface{...} are:

  alpha           1.0
  color           :black
  colormap        :viridis
  colorrange      AbstractPlotting.Automatic()
  linewidth       1
  overdraw        false
  shading         true
  transparency    false
  visible         true
source
AbstractPlotting.text!Method
text(string)

Plots a text.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.text!,T} where T are:

source
AbstractPlotting.textMethod
text(string)

Plots a text.

Theme

Available attributes and their defaults for Text{...} are:

  align           (:left, :bottom)
  alpha           1.0
  color           :black
  font            "Dejavu Sans"
  linewidth       1
  overdraw        false
  position        Float32[0.0, 0.0]
  rotation        0.0
  strokecolor     (:black, 0.0)
  strokewidth     0
  textsize        20
  transparency    false
  visible         true
source
AbstractPlotting.timeseries!Method
timeseries(x::Node{{Union{Number, Point2}}})

Plots a sampled signal. Usage:

signal = Node(1.0)
scene = timeseries(signal)
display(scene)
# @async is optional, but helps to continue evaluating more code
@async while isopen(scene)
    # aquire data from e.g. a sensor:
    data = rand()
    # update the signal
    signal[] = data
    # sleep/ wait for new data/ whatever...
    # It's important to yield here though, otherwise nothing will be rendered
    sleep(1/30)
end
source
AbstractPlotting.timeseriesMethod
timeseries(x::Node{{Union{Number, Point2}}})

Plots a sampled signal. Usage:

signal = Node(1.0)
scene = timeseries(signal)
display(scene)
# @async is optional, but helps to continue evaluating more code
@async while isopen(scene)
    # aquire data from e.g. a sensor:
    data = rand()
    # update the signal
    signal[] = data
    # sleep/ wait for new data/ whatever...
    # It's important to yield here though, otherwise nothing will be rendered
    sleep(1/30)
end
source
AbstractPlotting.titleMethod
title(
    [scene=current_scene(), ], string;
    align = (:center, :bottom), textsize = 30, parent = Scene(), kw...
)

Add a title with content string to scene.

AbstractPlotting.to_colormapMethod
to_colormap(cm[, N = 20])

Converts a colormap cm symbol (e.g. :Spectral) to a colormap RGB array, where N specifies the number of color points.

AbstractPlotting.translate!Method
translate!(scene::Transformable, xyz::VecTypes)
translate!(scene::Transformable, xyz...)

Apply an absolute translation to the Scene, translating it to x, y, z.

AbstractPlotting.translate!Method
translate!(Accum, scene::Transformable, xyz...)

Translate the scene relative to its current position.

AbstractPlotting.update!Method
`update!(p::Scene)`

Updates a Scene and all its children. Update will perform the following operations for every scene:

if !scene.raw[]
    scene.update_limits[] && update_limits!(scene)
    scene.scale_plot[] && scale_scene!(scene)
    scene.center[] && center!(scene)
end
AbstractPlotting.update_cam!Function
update_cam!(scene::Scene, eyeposition, lookat, up = Vec3f0(0, 0, 1))

Updates the camera's controls to point to the specified location.

AbstractPlotting.update_cam!Method
`update_cam!(scene::SceneLike, area)`

Updates the camera for the given scene to cover the given area in 2d.

AbstractPlotting.update_cam!Method
`update_cam!(scene::SceneLike)`

Updates the camera for the given scene to cover the limits of the Scene. Useful when using the Node pipeline.

AbstractPlotting.update_limits!Function
update_limits!(scene::Scene, new_limits::HyperRectangle, padding = Vec3f0(0))

This function updates the limits of the given Scene according to the given HyperRectangle.

A HyperRectangle is a generalization of a rectangle to n dimensions. It contains two vectors. The first vector defines the origin; the second defines the displacement of the vertices from the origin. This second vector can be thought of in two dimensions as a vector of width (x-axis) and height (y-axis), and in three dimensions as a vector of the width (x-axis), breadth (y-axis), and height (z-axis).

Such a HyperRectangle can be constructed using the FRect or FRect3D functions that are exported by AbstractPlotting.jl. See their documentation for more information.

AbstractPlotting.update_limits!Method
update_limits!(scene::Scene, limits::Union{Automatic, Rect} = scene.limits[], padding = scene.padding[])

This function updates the limits of the Scene passed to it based on its data. If an actual limit is set by the theme or its attributes (scene.limits !== automatic), it will not update the limits. Call update_limits!(scene, automatic) for that.

AbstractPlotting.vboxMethod
vbox(scenes...; parent = Scene(clear = false), kwargs...)

Box the scenes together on the vertical axis. For example, two Scenes vboxed will be placed side-by-side.



– Scene 1 – – Scene 2 –



AbstractPlotting.volume!Method
volume(volume_data)

Plots a volume. Available algorithms are:

  • :iso => IsoValue
  • :absorption => Absorption
  • :mip => MaximumIntensityProjection
  • :absorptionrgba => AbsorptionRGBA
  • :indexedabsorption => IndexedAbsorptionRGBA

Theme

Available attributes and their defaults for Combined{AbstractPlotting.volume!,T} where T are:

source
AbstractPlotting.volumeMethod
volume(volume_data)

Plots a volume. Available algorithms are:

  • :iso => IsoValue
  • :absorption => Absorption
  • :mip => MaximumIntensityProjection
  • :absorptionrgba => AbsorptionRGBA
  • :indexedabsorption => IndexedAbsorptionRGBA

Theme

Available attributes and their defaults for Volume{...} are:

  absorption      1.0f0
  algorithm       :iso
  alpha           1.0
  color           "nothing"
  colormap        :viridis
  colorrange      (0, 1)
  isorange        0.05f0
  isovalue        0.5f0
  linewidth       1
  overdraw        false
  transparency    false
  visible         true
source
AbstractPlotting.volumeslices!Method
VolumeSlices

TODO add function signatures TODO add descripton

Theme

Available attributes and their defaults for Combined{AbstractPlotting.volumeslices!,T} where T are:

source
AbstractPlotting.volumeslicesMethod
VolumeSlices

TODO add function signatures TODO add descripton

Theme

Available attributes and their defaults for VolumeSlices{...} are:

  alpha       0.1
  colormap    :viridis
  colorrange  "nothing"
  contour     Dict{Any,Any} with 0 entries
  heatmap     Dict{Any,Any} with 0 entries
source
AbstractPlotting.wireframe!Method
`wireframe(x, y, z)`, `wireframe(positions)`, or `wireframe(mesh)`

Draws a wireframe, either interpreted as a surface or as a mesh.

Theme

Available attributes and their defaults for Combined{AbstractPlotting.wireframe!,T} where T are:

source
AbstractPlotting.wireframeMethod
`wireframe(x, y, z)`, `wireframe(positions)`, or `wireframe(mesh)`

Draws a wireframe, either interpreted as a surface or as a mesh.

Theme

Available attributes and their defaults for Wireframe{...} are:

  alpha           1.0
  color           :black
  colormap        :viridis
  colorrange      AbstractPlotting.Automatic()
  linestyle       "nothing"
  linewidth       1.0
  overdraw        false
  transparency    false
  visible         true
source
AbstractPlotting.xlabel!Method
xlabel!([scene,] xlabel)

Set the x-axis label for the given Scene. Defaults to using the current Scene.

AbstractPlotting.xlims!Method
xlims!(limits::Real...)
xlims!(limits::NTuple{2, Real})
xlims!(scene, limits::Real...)
xlims!(scene, limits::NTuple{2, Real})

Set the x-limits for the given Scene (defaults to current Scene).

AbstractPlotting.ylabel!Method
ylabel!([scene,] ylabel)

Set the y-axis label for the given Scene. Defaults to using the current Scene.

AbstractPlotting.ylims!Method
ylims!(limits::Real...)
ylims!(limits::NTuple{2, Real})
ylims!(scene, limits::Real...)
ylims!(scene, limits::NTuple{2, Real})

Set the y-limits for the given Scene (defaults to current Scene).

AbstractPlotting.zlabel!Method
zlabel!([scene,] zlabel)

Set the z-axis label for the given Scene. Defaults to using the current Scene.

Warning

The Scene must have an Axis3D. If not, then this function will error.

AbstractPlotting.zlims!Method
zlims!(limits::Real...)
zlims!(limits::NTuple{2, Real})
zlims!(scene, limits::Real...)
zlims!(scene, limits::NTuple{2, Real})

Set the z-limits for the given Scene (defaults to current Scene).

AbstractPlotting.zoom!Method
zoom!(scene, point, zoom_step)

Zooms the camera of scene in towards point by a factor of zoom_step.

FileIO.saveMethod
save(path::String, io::VideoStream; framerate = 24)

Flushes the video stream and converts the file to the extension found in path, which can be one of the following:

  • .mkv (the default, doesn't need to convert)
  • .mp4 (good for Web, most supported format)
  • .webm (smallest file size)
  • .gif (largest file size for the same quality)

.mp4 and .mk4 are marginally bigger and .gifs are up to 6 times bigger with the same quality!

See the docs of VideoStream for how to create a VideoStream. If you want a simpler interface, consider using record.

FileIO.saveMethod
FileIO.save(filename, scene; resolution = size(scene))

Saves a Scene to file! Allowable formats depend on the backend;

  • GLMakie allows .png, .jpeg, and .bmp.
  • CairoMakie allows .svg, pdf, and .jpeg.
  • WGLMakie allows .png.

Resolution can be specified, via save("path", scene, resolution = (1000, 1000))!

Observables.onMethod
on(f, c::Camera, nodes::Node...)

When mapping over nodes for the camera, we store them in the steering_node vector, to make it easier to disconnect the camera steering signals later!

AbstractPlotting.@extractvalueMacro

usage @extractvalue scene (a, b, c, d) will become:

begin
    a = to_value(scene[:a])
    b = to_value(scene[:b])
    c = to_value(scene[:c])
    (a, b, c)
end
AbstractPlotting.@get_attributeMacro
@get_attribute scene (a, b, c, d)

This will extract attribute a, b, c, d from scene and apply the correct attribute conversions + will extract the value if it's a signal. It will make those attributes available as variables and return them as a tuple. So the above is equal to: will become:

begin
    a = get_attribute(scene, :a)
    b = get_attribute(scene, :b)
    c = get_attribute(scene, :c)
    (a, b, c)
end
AbstractPlotting.@recipeMacro

Plot Recipes in AbstractPlotting

There's two types of recipes. Type recipes define a simple mapping from a user defined type to an existing plot type. Full recipes can customize the theme and define a custom plotting function.

Type recipes

Type recipe are really simple and just overload the argument conversion pipeline. This can be done for all plot types or for a subset of plot types:

# All plot types
convert_arguments(P::Type{<:AbstractPlot}, x::MyType) = convert_arguments(P, rand(10, 10))
# Only for scatter plots
convert_arguments(P::Type{<:Scatter}, x::MyType) = convert_arguments(P, rand(10, 10))

Optionally you may define the default plot type so that plot(x::MyType) will use this:

plottype(::MyType) = Surface

Full recipes with the @recipe macro

A full recipe for MyPlot comes in two parts. First is the plot type name, arguments and theme definition which are defined using the @recipe macro. Second is a custom plot! for MyPlot, implemented in terms of the atomic plotting functions.

We use an example to show how this works:

# arguments (x, y, z) && theme are optional
@recipe(MyPlot, x, y, z) do scene
    Theme(
        plot_color => :red
    )
end

This macro expands to several things. Firstly a type definition:

const MyPlot{ArgTypes} = Combined{myplot, ArgTypes}

The type parameter of Combined contains the function instead of e.g. a symbol. This way the mapping from MyPlot to myplot is safer and simpler. (The downside is we always need a function myplot - TODO: is this a problem?)

The following signatures are defined to make MyPlot nice to use:

myplot(args...; kw_args...) = ...
myplot!(scene, args...; kw_args...) = ...
myplot(kw_args::Dict, args...) = ...
myplot!(scene, kw_args::Dict, args...) = ...
#etc (not 100% settled what signatures there will be)

A specialization of argument_names is emitted if you have an argument list (x,y,z) provided to the recipe macro:

argument_names(::Type{<: MyPlot}) = (:x, :y, :z)

This is optional but it will allow the use of plot_object[:x] to fetch the first argument from the call plot_object = myplot(rand(10), rand(10), rand(10)), for example. Alternatively you can always fetch the ith argument using plot_object[i], and if you leave out the (x,y,z), the default version of argument_names will provide plot_object[:arg1] etc.

The theme given in the body of the @recipe invocation is inserted into a specialization of default_theme which inserts the theme into any scene that plots MyPlot:

function default_theme(scene, ::MyPlot)
    Theme(
        plot_color => :red
    )
end

As the second part of defining MyPlot, you should implement the actual plotting of the MyPlot object by specializing plot!:

function plot!(plot::MyPlot)
    # normal plotting code, building on any previously defined recipes
    # or atomic plotting operations, and adding to the combined `plot`:
    lines!(plot, rand(10), color = plot[:plot_color])
    plot!(plot, plot[:x], plot[:y])
    plot
end

It's possible to add specializations here, depending on the argument types supplied to myplot. For example, to specialize the behavior of myplot(a) when a is a 3D array of floating point numbers:

const MyVolume = MyPlot{Tuple{<:AbstractArray{<: AbstractFloat, 3}}}
argument_names(::Type{<: MyVolume}) = (:volume,) # again, optional
function plot!(plot::MyVolume)
    # plot a volume with a colormap going from fully transparent to plot_color
    volume!(plot, plot[:volume], colormap = :transparent => plot[:plot_color])
    plot
end

The docstring given to the recipe will be transferred to the functions it generates.

What isn't

AbstractPlotting.ColorSamplerType

A colorsampler maps numnber values from a certain range to values of a colormap

x = ColorSampler(colormap, (0.0, 1.0))
x[0.5] # returns color at half point of colormap
AbstractPlotting.TransformableType
abstract type Transformable

This is a bit of a weird name, but all scenes and plots are transformable, so that's what they all have in common. This might be better expressed as traits.

AbstractPlotting.atomic_limitsMethod

Data limits calculate a minimal boundingbox from the data points in a plot. This doesn't include any transformations, markers etc.

AbstractPlotting.colorswatchFunction
colorswatch(scene = Scene(camera = campixel!))

TODO add function signatures TODO add description

Theme

Available attributes and their defaults for Combined{AbstractPlotting.colorswatch,T} where T are:

AbstractPlotting.default_plot_signaturesMethod
 default_plot_signatures(funcname, funcname!, PlotType)

Creates all the different overloads for funcname that need to be supported for the plotting frontend! Since we add all these signatures to different functions, we make it reusable with this function. The Core.@__doc__ macro transfers the docstring given to the Recipe into the functions.

AbstractPlotting.default_printerMethod
default_printer(v)

Prints v rounded to three digits. Here, v can be of any type accepted by round, which includes Real, Complex and many others. To use your own custom datatype it is sufficient to define Base.round(x::NewType, r::RoundingMode).

AbstractPlotting.detach!Method

Remove combined from the current parent, and add it to a new subscene of the parent scene. Returns the new parent.

AbstractPlotting.dont_touchMethod
dont_touch(
    parent::GeometryPrimitive{N}, child::GeometryPrimitive{N},
    pad::Vec{N}
) where N

Moves child so that it doesn't touch parent. Leaves a gap to parent defined by pad.

AbstractPlotting.fit_factorMethod
fit_factor(rect, lims::NTuple{N}) where N

Calculates the scaling one needs to apply to lims to fit rect without changing aspect ratio. Returns float scaling and the full strech as given by fit_factor_stretch

AbstractPlotting.fit_factor_stretchMethod
fit_factor_stretch(rect, lims::NTuple{N}) where N

Calculates the stretch factor to fill rect in all dimension. Returns a stretch N dimensional fit factor.

AbstractPlotting.fit_ratioMethod
fit_ratio(rect, lims)

Calculates the ratio one needs to stretch lims in order to get the same aspect ratio

AbstractPlotting.from_dictMethod
from_dict(::Type{T}, dict)

Creates the type T from the fields in dict. Automatically converts to the correct node types.

AbstractPlotting.frustumMethod
Create view frustum

Parameters
----------
    left : float
     Left coordinate of the field of view.
    right : float
     Left coordinate of the field of view.
    bottom : float
     Bottom coordinate of the field of view.
    top : float
     Top coordinate of the field of view.
    znear : float
     Near coordinate of the field of view.
    zfar : float
     Far coordinate of the field of view.

Returns
-------
    M : array
     View frustum matrix (4x4).
AbstractPlotting.getscreenMethod
getscreen(scene::Scene)

Gets the current screen a scene is associated with. Returns nothing if not yet displayed on a screen.

AbstractPlotting.interpolated_getindexMethod
interpolated_getindex(cmap::AbstractArray, value::AbstractFloat, norm = (0.0, 1.0))

Like getindex, but accepts values between 0..1 and interpolates those to the full range. You can use norm, to change the range of 0..1 to whatever you want.

AbstractPlotting.lookatMethod

view = lookat(eyeposition, lookat, up) creates a view matrix with the eye located at eyeposition and looking at position lookat, with the top of the window corresponding to the direction up. Only the component of up that is perpendicular to the vector pointing from eyeposition to lookat will be used. All inputs must be supplied as 3-vectors.

AbstractPlotting.move_from_touchMethod
move_from_touch(
    parent::GeometryPrimitive{N, T}, child::GeometryPrimitive{N},
    pad::Vec{N}
) where {N, T}

calculates how much child rectangle needs to move to not touch the parent

AbstractPlotting.perspectiveprojectionMethod

proj = perspectiveprojection([T], fovy, aspect, znear, zfar) defines a projection matrix with a given angular field-of-view fovy along the y-axis (measured in degrees), the specified aspect ratio, and near and far clipping planes znear, zfar. Optionally specify the element type T of the matrix.

AbstractPlotting.perspectiveprojectionMethod

proj = perspectiveprojection([T], rect, fov, near, far) defines the projection ratio in terms of the rectangular view size rect rather than the aspect ratio.

AbstractPlotting.plottypeMethod
`plot_type(plot_args...)`

The default plot type for any argument is lines. Any custom argument combination that has only one meaningful way to be plotted should overload this. e.g.:

    # make plot(rand(5, 5, 5)) plot as a volume
    plottype(x::Array{<: AbstractFlot, 3}) = Volume
AbstractPlotting.plottypeMethod
plottype(P1::Type{<: Combined{T1}}, P2::Type{<: Combined{T2}})

Chooses the more concrete plot type ```example function convert_arguments(P::PlotFunc, args...) ptype = plottype(P, Lines) ... end

AbstractPlotting.print_recFunction
print_rec(io::IO, dict, indent::Int = 1[; extended = false])

Traverses a dictionary dict and recursively print out its keys and values in a nicely-indented format.

Use the optional extended = true keyword argument to see more details.

AbstractPlotting.resampleMethod
resample(A::AbstractVector, len::Integer)

Resample a vector with linear interpolation to have length len

AbstractPlotting.resampled_colorsMethod
resampled_colors(attributes::Attributes, levels::Integer)

Resample the color attribute from attributes. Resamples :colormap if present, or repeats :color.

AbstractPlotting.sig_printerMethod
sig_printer(v::Real)

Prints the first three significant digits of v in scientific notation.

julia> -5:5 .|> exp .|> sig_printer
11-element Array{String,1}:
 "6.74e-03"
 "1.83e-02"
 "4.98e-02"
 "1.35e-01"
 "3.68e-01"
 "1.00e+00"
 "2.72e+00"
 "7.39e+00"
 "2.01e+01"
 "5.46e+01"
 "1.48e+02"
AbstractPlotting.streamplot_implMethod
streamplot_impl(CallType, f, limits::Rect{N, T}, resolutionND, stepsize)

Code adapted from an example implementation by Moritz Schauer (@mschauer) from https://github.com/JuliaPlots/Makie.jl/issues/355#issuecomment-504449775

Background: The algorithm puts an arrow somewhere and extends the streamline in both directions from there. Then, it chooses a new position (from the remaining ones), repeating the the exercise until the streamline gets blocked, from which on a new starting point, the process repeats.

So, ideally, the new starting points for streamlines are not too close to current streamlines.

Links:

Quasirandom sequences

AbstractPlotting.to_spritemarkerMethod

Vector of anything that is accepted as a single marker will give each point it's own marker. Note that it needs to be a uniform vector with the same element type!

AbstractPlotting.used_attributesMethod
used_attributes(args...) = ()

function used to indicate what keyword args one wants to get passed in convert_arguments. Usage:

    struct MyType end
    used_attributes(::MyType) = (:attribute,)
    function convert_arguments(x::MyType; attribute = 1)
        ...
    end
    # attribute will get passed to convert_arguments
    # without keyword_verload, this wouldn't happen
    plot(MyType, attribute = 2)
    #You can also use the convenience macro, to overload convert_arguments in one step:
    @keywords convert_arguments(x::MyType; attribute = 1)
        ...
    end