I need a parametric form for a matplotlib.path.Path
. So I used the .vertices
attribute, and it works fine except that the number of points given is too low for the use I want. Here is a code to illustrate :
import numpy as np
from matplotlib import pyplot as plt
import matplotlib.patches as mpat
fig, ax = plt.subplots()
ax.set(xlim=(-6, 6), ylim=(-6, 6))
# generate a circular path
circle = mpat.Arc((0, 0), 10, 10, theta1=20, theta2=220, color='green')
path = circle.get_transform().transform_path(circle.get_path()).cleaned().vertices[:-3] # get_path is not enough because of the transformation, so we apply to the path the same transformation as the circle has got from the identity circle
ax.add_patch(circle)
# plot path vertices
plt.scatter(x=path[:, 0], y=path[:, 1], color='red', s=2)
shape = len(path)
plt.show()
How to increase the number of points (red) to fetch better the path (green)? Or, how can I increase the len
of path
?
Thanks in advance!