Plotting functions overview

The follow document lists the atomic plotting functions and their usage. These are the most atomic primitives which one can stack together to form more complex plots.

For general help about each function, consult the Help functions.

See Plot function signatures for the available plot function signatures.

See Plot attributes for the available plot attributes.

text

AbstractPlotting.textFunction
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

library lines 283:283 library lines 293:308 library lines 87:116 library lines 234:259

meshscatter

AbstractPlotting.meshscatterFunction
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

library lines 30:55 library lines 136:141 library lines 155:170 library lines 336:385 library lines 415:417 library lines 594:613 library lines 120:164 library lines 3:38 library lines 4:63

scatter

AbstractPlotting.scatterFunction
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

library lines 5:8 library lines 12:15 library lines 35:46 library lines 105:105 library lines 207:211 library lines 249:253 library lines 272:278 library lines 312:331 library lines 335:366 library lines 380:463 library lines 145:145 library lines 149:149 library lines 392:401 library lines 404:405 library lines 457:469 library lines 473:474 library lines 3:51 library lines 55:67 library lines 71:82 library lines 220:251 library lines 255:299 library lines 4:32 library lines 37:41 library lines 61:62 library lines 66:73 library lines 77:77 library lines 85:89 library lines 4:10 library lines 4:94 library lines 102:152

mesh

AbstractPlotting.meshFunction
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

library lines 76:89 library lines 158:181 library lines 184:184 library lines 4:14 library lines 17:25 library lines 62:65 library lines 68:69 library lines 72:81 library lines 84:85 library lines 282:288 library lines 336:385 library lines 443:449 library lines 453:453 library lines 478:487 library lines 404:547

linesegments

AbstractPlotting.linesegmentsFunction
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

library lines 94:99 library lines 230:238 library lines 370:371 library lines 491:539 library lines 305:399 library lines 263:288 library lines 4:63

lines

AbstractPlotting.linesFunction
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

library lines 4:25 library lines 249:253 library lines 256:257 library lines 380:463 library lines 469:525 library lines 561:588 library lines 608:611 library lines 617:620 library lines 630:641 library lines 668:681 library lines 708:741 library lines 129:132 library lines 392:401 library lines 491:539 library lines 544:578 library lines 3:51 library lines 87:116 library lines 404:547 library lines 46:56 library lines 194:230 library lines 3:38 library lines 47:108 library lines 4:10

surface

AbstractPlotting.surfaceFunction
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

library lines 91:99 library lines 102:110 library lines 116:123 library lines 233:241 library lines 245:260 library lines 267:278 library lines 296:332 library lines 421:438 library lines 582:590 library lines 291:305 library lines 55:86 library lines 4:10 library lines 19:23

volume

AbstractPlotting.volumeFunction
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

library lines 59:59 library lines 175:190 library lines 650:667 library lines 676:723 library lines 19:24 library lines 28:33 library lines 37:42

heatmap

AbstractPlotting.heatmapFunction
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

library lines 89:90 library lines 30:31 library lines 109:129 library lines 190:194 library lines 268:268 library lines 335:366 library lines 685:687 library lines 175:190 library lines 55:67 library lines 220:251 library lines 603:661 library lines 4:10 library lines 19:23

image

AbstractPlotting.imageFunction
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

library lines 30:31 library lines 99:99 library lines 207:211 library lines 4:14 library lines 17:25 library lines 116:123 library lines 233:241 library lines 404:405 library lines 93:118 library lines 19:23

contour

AbstractPlotting.contourFunction
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

library lines 244:246 library lines 263:264 library lines 175:190 library lines 582:590 library lines 603:661 library lines 4:8 library lines 12:15 library lines 46:51 library lines 55:86 library lines 19:23

arrows

AbstractPlotting.arrowsFunction
`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

library lines 66:72 library lines 76:89 library lines 668:681 library lines 217:229 library lines 245:260

barplot

AbstractPlotting.barplotFunction
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

library lines 103:104 library lines 52:52

poly

AbstractPlotting.polyFunction
`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

library lines 57:63 library lines 133:155 library lines 230:238 library lines 87:116 library lines 168:216

band

AbstractPlotting.bandFunction
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

slider

AbstractPlotting.sliderFunction
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

library lines 71:82 library lines 120:164 library lines 255:299 library lines 305:399 library lines 404:547 library lines 551:599 library lines 47:108

vbox

AbstractPlotting.vboxFunction
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 –



library lines 109:129 library lines 267:278 library lines 71:82 library lines 120:164 library lines 305:399 library lines 404:547 library lines 263:288 library lines 4:10 library lines 19:23

hbox

AbstractPlotting.hboxFunction
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 –



library lines 249:253 library lines 120:164