Matplotlib 2.0.0rc1 is available

Install the release candidate now!



This Page

pylab_examples example code: marker_path.pyΒΆ

(Source code, png, hires.png, pdf)

import matplotlib.pyplot as plt
import matplotlib.path as mpath
import numpy as np

star = mpath.Path.unit_regular_star(6)
circle = mpath.Path.unit_circle()
# concatenate the circle with an internal cutout of the star
verts = np.concatenate([circle.vertices, star.vertices[::-1, ...]])
codes = np.concatenate([,])
cut_star = mpath.Path(verts, codes)

plt.plot(np.arange(10)**2, '--r', marker=cut_star, markersize=15)

Keywords: python, matplotlib, pylab, example, codex (see Search examples)