Python使用matplotlib.pyplot?as?plt繪圖圖層優(yōu)先級(jí)問(wèn)題
前言:
在最近做多智能車(chē)的控制時(shí),繪制障礙物的時(shí)候發(fā)現(xiàn)障礙物的圖層被路面圖層所覆蓋,一時(shí)不知道怎么解決,其實(shí)在用matplotlib.pyplot 繪圖的時(shí)候可以使用參數(shù)zorder設(shè)置優(yōu)先級(jí)進(jìn)行調(diào)節(jié),zorder整數(shù)越大,顯示時(shí)越靠上。
調(diào)整前:
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)

調(diào)整后:
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)

到此這篇關(guān)于Python使用matplotlib.pyplot as plt繪圖圖層優(yōu)先級(jí)問(wèn)題的文章就介紹到這了,更多相關(guān)python圖層優(yōu)先級(jí)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
python開(kāi)發(fā)之基于thread線程搜索本地文件的方法
這篇文章主要介紹了python開(kāi)發(fā)之基于thread線程搜索本地文件的方法,以完整實(shí)例形式分析了Python基于多線程處理搜索問(wèn)題的相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2015-11-11
Python裝飾器如何實(shí)現(xiàn)修復(fù)過(guò)程解析
這篇文章主要介紹了Python裝飾器如何實(shí)現(xiàn)修復(fù)過(guò)程解析,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-09-09
python學(xué)習(xí)之基于Python的人臉識(shí)別技術(shù)學(xué)習(xí)
面部識(shí)別技術(shù)的應(yīng)用越來(lái)越廣泛,它廣泛應(yīng)用于安全系統(tǒng)、人機(jī)交互、社交媒體、醫(yī)療保健等領(lǐng)域。本文介紹了基于Python的人臉識(shí)別技術(shù),感興趣的小伙伴可以參考閱讀2023-03-03
利用Python-iGraph如何繪制貼吧/微博的好友關(guān)系圖詳解
這篇文章主要給大家介紹了關(guān)于利用Python-iGraph如何繪制貼吧/微博好友關(guān)系圖的相關(guān)資料,文中顯示介紹了在windows系統(tǒng)下安裝python-igraph的步驟,然后通過(guò)示例代碼演示了繪制好友關(guān)系圖的方法,需要的朋友可以參考下。2017-11-11

