沃罗诺伊普洛特
|
该页面正在翻译中。 |
#
<无翻译>*麦琪沃罗诺伊普洛特*-Function
voronoiplot(x, y, values; kwargs...)
voronoiplot(values; kwargs...)
voronoiplot(x, y; kwargs...)
voronoiplot(positions; kwargs...)
voronoiplot(vorn::VoronoiTessellation; kwargs...)
生成并绘制Voronoi tessalation 热图-或点状数据。 镶嵌也可以直接传递为 鹿VoronoiTessellation 来自DelaunayTriangulation。jl.
绘图类型
绘图类型别名 沃罗诺伊普洛特 功能是 沃罗诺伊普洛特.
例子:
using CairoMakie
using Random
Random.seed!(1234)
f = Figure(size=(1200, 450))
ax = Axis(f[1, 1])
voronoiplot!(ax, rand(Point2f, 50))
ax = Axis(f[1, 2])
voronoiplot!(ax, rand(10, 10), rand(10, 10), rand(10, 10))
f
沃罗诺伊普洛特 使用来自https://github.com/DanielVandH/DelaunayTriangulation.jl[DelaunayTriangulation.jl]生成细胞。 你也可以自己做,直接绘制 鹿VoronoiTessellation 返回的对象。
</无翻译>
using CairoMakie
using DelaunayTriangulation
using Random
Random.seed!(1234)
points = rand(2, 50)
tri = triangulate(points)
vorn = voronoi(tri)
f, ax, tr = voronoiplot(vorn)
f
在考虑标准曲面时,无界多边形会在默认情况下自动确定的边界框处裁剪,或者从用户提供的裁剪形状(矩形或圆形)裁剪。 自动边界框由曲面细分生成器的边界框确定,这意味着提供的点,通过某种因素扩展出来 未绑定的_edge_extension_factor (默认 0.1)与边界框边的长度成正比。
</无翻译>
using CairoMakie
using DelaunayTriangulation
using Random
Random.seed!(1234)
z = LinRange(0, 1, 250) .* exp.(LinRange(0, 16pi, 250) .* im)
f, ax, tr = voronoiplot(real(z), imag(z), unbounded_edge_extension_factor = 0.4, markersize = 7)
f
using CairoMakie
using DelaunayTriangulation
using Random
Random.seed!(1234)
x = LinRange(0, 16pi, 50)
y = sin.(x)
bb = BBox(-1, 16pi + 1, -30, 30) # (xmin, xmax, ymin, ymax)
f, ax, tr = voronoiplot(x, y, show_generators=false,
clip=bb, color=:white, strokewidth=2)
f
using CairoMakie
using DelaunayTriangulation
使用随机
随机的。种子!(1234)
积分= [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)]
三=三角(分)
精炼!(tri;max_area=0.001)
vorn=voronoi(tri,clip=true)
f,ax,tr=voronoiplot(vorn,show_generators=true,markersize=13,marker='x')
f
using CairoMakie
using DelaunayTriangulation
using Random
Random.seed!(1234)
angles = range(0, 2pi, length = 251)[1:end-1]
x = cos.(angles)
y = sin.(angles)
points = tuple.(x, y)
tri = triangulate(points)
refine!(tri; max_area = 0.001)
vorn = voronoi(tri, clip = true)
smooth_vorn = centroidal_smooth(vorn)
f, ax, tr = voronoiplot(smooth_vorn, show_generators=false)
f
属性
剪辑/剪辑
默认值为 自动的
设置生成的多边形的裁剪区域,该多边形可以是 直肠2 (或 BBox的), 元组 与条目 (xmin,xmax,ymin,ymax) 或作为 圆. 指定区域之外的任何内容都将被删除。 如果 剪辑/剪辑 未设置它是自动确定使用 未绑定的_edge_extension_factor 作为一个 校长.