python - Matplotlib 仅在身体上注释虚线花式箭头,而不是头部
问题描述
以下代码生成带有虚线轮廓线的箭头。我想保持两个头之间的界线是虚线,但不是我想明确的头周围的界线。
实际上,如果线条和补丁颜色相同,则箭头的头部是锯齿状的。
我真的不知道从哪里开始。
import matplotlib.pyplot as plt
plt.figure()
ax = plt.gca()
ax.annotate("", xy = (0.2,0.2), xytext = (0.8,0.8), arrowprops = dict(arrowstyle="<|-|>", shrinkA = 0, shrinkB = 0, linestyle = '--', mutation_scale = 30))
ax.annotate("", xy = (0.2,0.3), xytext = (0.9,0.8), arrowprops = dict(arrowstyle="<|-|>", shrinkA = 0, shrinkB = 0, linestyle = '--', mutation_scale = 30, color = 'r', linewidth = 2))
plt.show()
解决方案
推荐阅读
- scala - kafka 线程消息从生产者到消费者 kafka 主题
- react-native - 带 ImageBackground 的 SafeAreaView
- python - 用python和json编码
- javascript - 时刻js判断已经过去多少天、几周
- php - 从数组中排除 NULL 和数值
- node.js - Amazon KMS - 预期用途
- docker - Docker 容器中的 dotnet ef 数据库更新失败并出现错误权限
- php - 函数中的 PHP curl 不返回 antyhing
- image - Webpack 不使用绝对路径加载本地图像
- node.js - 使用 Nginx 作为 AWS EC2 上的代理服务器,使用 socket.io 运行 NodeJs 应用程序