这篇文章主要介绍“Python怎么使用matplotlib.pyplot as plt绘图图层优先级”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“Python怎么使用matplotlib.pyplot as plt绘图图层优先级”文章能帮助大家解决问题。
调整前:
ax.hlines(y=30, xmin=-50, xmax=200, color='gray', linewidth=50)ax.hlines(y=0, xmin=-50, xmax=200, color='gray', linewidth=50)ax.hlines(y=-30, xmin=-50, xmax=200, color='gray', linewidth=50)obstacle = plt.Circle((120.0, -5.0), 5.0, color='red', fill=True, linewidth=1)obstacle1 = plt.Circle((60.0, 27.0), 5.0, color='red', fill=True, linewidth=1)obstacle2 = plt.Circle((60.0, -29.0), 5.0, color='red', fill=True, linewidth=1)
调整后:
ax.hlines(y=30, xmin=-50, xmax=200, color='gray', linewidth=50, zorder=1)ax.hlines(y=0, xmin=-50, xmax=200, color='gray', linewidth=50, zorder=1)ax.hlines(y=-30, xmin=-50, xmax=200, color='gray', linewidth=50, zorder=1)obstacle = plt.Circle((120.0, -5.0), 5.0, color='red', fill=True, linewidth=1, zorder=2)obstacle1 = plt.Circle((60.0, 27.0), 5.0, color='red', fill=True, linewidth=1, zorder=2)obstacle2 = plt.Circle((60.0, -29.0), 5.0, color='red', fill=True, linewidth=1, zorder=2)
关于“Python怎么使用matplotlib.pyplot as plt绘图图层优先级”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识,可以关注编程网行业资讯频道,小编每天都会为大家更新不同的知识点。