网络编程
位置:首页>> 网络编程>> Python编程>> matplotlib绘图实例演示标记路径

matplotlib绘图实例演示标记路径

作者:mengwei  发布时间:2021-10-18 08:51:04 

标签:matplotlib,标记

标记路径

演示效果:

matplotlib绘图实例演示标记路径

实例代码


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([circle.codes, star.codes])
cut_star = mpath.Path(verts, codes)

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

plt.show()

来源:https://matplotlib.org/index.html

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com