poly
poly(vertices, indices; kwargs...)
poly(points; kwargs...)
poly(shape; kwargs...)
poly(mesh; 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
GeometryBasics
), 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).
Attributes
Specific to
Poly
-
lowclip::Union{Nothing, Symbol, <:Colorant} = nothingsets a color for any value below the colorrange. -
highclip::Union{Nothing, Symbol, <:Colorant} = nothingsets a color for any value above the colorrange. -
strokecolor::Union{Symbol, <:Colorant} = :blacksets the color of the outline around a marker. -
strokewidth::Real = 0sets the width of the outline around a marker. -
linestyle::Union{Nothing, Symbol, Vector} = nothingsets the pattern of the line (e.g.:solid,:dot,:dashdot)
Generic
-
visible::Bool = truesets whether the plot will be rendered or not. -
overdraw::Bool = falsesets whether the plot will draw over other plots. This specifically means ignoring depth checks in GL backends. -
transparency::Bool = falseadjusts how the plot deals with transparency. In GLMakietransparency = trueresults in using Order Independent Transparency. -
fxaa::Bool = trueadjusts whether the plot is rendered with fxaa (anti-aliasing). -
inspectable::Bool = truesets whether this plot should be seen byDataInspector. -
coloris set by the plot. -
colormap::Union{Symbol, Vector{<:Colorant}} = [:black, :whitesets the colormap that is sampled for numericcolors. -
colorrange::Tuple{<:Real, <:Real}sets the values representing the start and end points ofcolormap. -
nan_color::Union{Symbol, <:Colorant} = RGBAf(0,0,0,0)sets a replacement color forcolor = NaN. -
space::Symbol = :datasets the transformation space for the position of the image. SeeMakie.spaces()for possible inputs. -
cycle::Vector{Symbol} = [:color => :patchcolor]sets which attributes to cycle when creating multiple plots. -
shading = falseenables lighting.
Examples
using CairoMakie
using Makie.GeometryBasics
f = Figure()
Axis(f[1, 1])
poly!(Point2f[(0, 0), (2, 0), (3, 1), (1, 1)], color = :red, strokecolor = :black, strokewidth = 1)
f
using CairoMakie
using Makie.GeometryBasics
f = Figure()
Axis(f[1, 1])
# polygon with hole
p = Polygon(
Point2f[(0, 0), (2, 0), (3, 1), (1, 1)],
[Point2f[(0.75, 0.25), (1.75, 0.25), (2.25, 0.75), (1.25, 0.75)]]
)
poly!(p, color = :blue)
f
using CairoMakie
using Makie.GeometryBasics
f = Figure()
Axis(f[1, 1])
# vector of shapes
poly!(
[Rect(i, j, 0.75, 0.5) for i in 1:5 for j in 1:3],
color = 1:15,
colormap = :heat
)
f
using CairoMakie
using Makie.GeometryBasics
f = Figure()
Axis(f[1, 1], aspect = DataAspect())
# shape decomposition
poly!(Circle(Point2f(0, 0), 15f0), color = :pink)
f
using CairoMakie
using Makie.GeometryBasics
f = Figure()
Axis(f[1, 1]; backgroundcolor = :gray15)
# vector of polygons
ps = [Polygon(rand(Point2f, 3) .+ Point2f(i, j))
for i in 1:5 for j in 1:10]
poly!(ps, color = rand(RGBf, length(ps)))
f
These docs were autogenerated using Makie: v0.18.4, GLMakie: v0.7.4, CairoMakie: v0.9.4, WGLMakie: v0.7.4