加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

matplotlib绘图实例演示标记路径

发布时间:2020-12-17 07:31:09 所属栏目:Python 来源:网络整理
导读:标记路径 演示效果: 实例代码 import matplotlib.pyplot as pltimport matplotlib.path as mpathimport numpy as npstar = mpath.Path.unit_regular_star(6)circle = mpath.Path.unit_circle()# concatenate the circle with an internal cutout of the sta

标记路径

演示效果:

实例代码

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()

总结

以上就是本文关于matplotlib绘图实例演示标记路径的全部内容,希望对大家有所帮助。感兴趣的朋友可以继续参阅本站其他相关专题,如有不足之处,欢迎留言指出。感谢朋友们对本站的支持!

您可能感兴趣的文章:

  • Python+matplotlib实现华丽的文本框演示代码
  • python+matplotlib实现动态绘制图片实例代码(交互式绘图)
  • python+matplotlib绘制饼图散点图实例代码
  • Python+matplotlib绘制不同大小和颜色散点图实例
  • Python基于matplotlib实现绘制三维图形功能示例
  • Python实现在tkinter中使用matplotlib绘制图形的方法示例
  • Python使用matplotlib实现绘制自定义图形功能示例
  • python+matplotlib绘制3D条形图实例代码

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读