python - Edit marker shape in python
问题描述
I'm using diamond pointer on the x-axis of a CDF plot to show the distribution of some data. As the number of data is high, these points are close together and not distinguishable. I was wondering if there is a way to make the diamond marker for scatter plot more pointy.
解决方案
You can define your own markers from a path, see the Marker Path Example.
import matplotlib.pyplot as plt
import matplotlib.path as mpath
pointed_diamond = mpath.Path([[0,-.5],[-.1,0],[0,.5],[.1,0],[0,-.5]], [1,2,2,2,79])
plt.plot([1,2,3], marker=pointed_diamond, markersize=10)
推荐阅读
- javascript - 在页面之间导航而不更改链接
- java - Google Gson 反序列化问题
- google-analytics - 如何在 Google Analytics 中删除数据导入
- javascript - php访问mqsql还是html访问json还是html访问xml?哪个更快?
- typescript - How to specify Typescript Mongoose model type in await
- python - 将输出导出到记事本
- javascript - 如何从 Promise 对象中获取数据并使用 ReactJS 将其放入 HTML 列表中?
- c# - 使用条件操作创建 WIX 安装程序
- sql-server-2008-r2 - 如何通过文本出现在 SQL Server 上订购全文查询?
- javascript - 什么时候适合柯里化一个函数,什么时候不适合?为什么?