import matplotlib.pyplot as plt
import numpy as np
from vizent import vizent_plot
hex_pnts = np.array([(1,0),
(0.5, (np.sqrt(3)/2)),
(-0.5, (np.sqrt(3)/2)),
(-1, 0),
(-0.5, -(np.sqrt(3)/2)),
(0.5, -(np.sqrt(3)/2)),
(1,0)])
zorder = 0
fancy_plot_pnts = []
for p in hex_pnts:
for q in hex_pnts:
fancy_plot_pnts.append((p[0] + q[0], p[1] + q[1]))
lines = [(fancy_plot_pnts[i], fancy_plot_pnts[i+1]) \
for i in range(len(fancy_plot_pnts)-1)]
lines = list(set(lines))
edge_start_points = [l[0] for l in lines]
edge_end_points = [l[1] for l in lines]
edge_colors = [np.random.random() for l in lines]
edge_frequencies = [np.random.choice(range(5)) for l in lines]
edge_widths = [5 for l in lines]
fig = vizent_plot(edge_start_points=edge_start_points,
edge_end_points=edge_end_points,
edge_colors=edge_colors,
edge_frequencies=edge_frequencies,
edge_widths=edge_widths,
edge_colormap='Purples',
edge_color_min=0,
edge_color_max=1)
# Add some styling
fig.axes[1].axis('equal')
fig.axes[1].set_facecolor('0.2')
fig.axes[1].xaxis.set_visible(False)
fig.axes[1].yaxis.set_visible(False)