動作環境
GeForce GTX 1070 (8GB)
ASRock Z170M Pro4S [Intel Z170chipset]
Ubuntu 16.04.4 LTS desktop amd64
TensorFlow v1.7.0
cuDNN v5.1 for Linux
CUDA v8.0
Python 3.5.2
IPython 6.0.0 -- An enhanced Interactive Python.
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
scipy v0.19.1
geopandas v0.3.0
MATLAB R2017b (Home Edition)
ADDA v.1.3b6
gnustep-gui-runtime v0.24.0-3.1
PyMieScatt v1.7.0

geometry > numpy > star shaped (星形) の座標を得る | Matplotlibでの描画 > v0.3:座標は得られた | v0.4: モジュール化
で作成したstar shapedに対してVoronoi diagramを作成してみた。

参考

code

モジュールgeometry_starShaped_180415は以下に掲載。
geometry > numpy > star shaped (星形) の座標を得る | Matplotlibでの描画 > v0.3:座標は得られた | v0.4: モジュール化

Voronoi_starShaped_180415.ipynb
%matplotlib inline

import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial import Voronoi, voronoi_plot_2d
from pylab import rcParams
import geometry_starShaped_180415 as GSS

'''
v0.1 Apr. 15, 2018
  - show Voronoi diagram
'''

rcParams['figure.figsize'] = 7, 7
rcParams['figure.dpi'] = 70

RAD_INNER = 5
RAD_OUTER = 10
xs, ys = GSS.get_starShaped(RAD_INNER, RAD_OUTER)

fig = plt.figure()

# star shaped
ax1 = fig.add_subplot(1, 1, 1)
ax1.scatter(xs, ys)
ax1.set_xlabel('x')
ax1.set_ylabel('y')
ax1.grid(True)

# Voronoi
wrk = [[ax, ay] for ax, ay in zip(xs, ys)]
vor = Voronoi(wrk)
voronoi_plot_2d(vor)

fig.tight_layout()

下図がVoronoi diagram。

qiita.png

Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.