0
我正在研究一個關於孤子穿過一個障礙的程序,我試圖讓這個障礙看起來像一個真正的,可以說,由磚塊製成。問題是,我無法找到如何繪製'磚'紋理。我使用fill_between(),但如果有另外一個選項允許使用磚塊,我不會有使用它的問題。磚牆與matplotlib
我的代碼是:
gs=GridSpec(8,1) #7 rows and 1 column
state=self.fig.add_subplot(gs[2:,:])
light=self.fig.add_subplot(gs[0:2,:])
state.set_xlabel("Position ($x/ \\xi$)")
state.set_ylabel("Density $|\psi|^2 \\xi$")
state.plot(posit,phi2)
state.fill_between(posit,phi2,0,facecolor='0.80')
potential=state.twinx()
potential.plot(posit,pote,'g')
與所有陣列明確定義等等。運行程序時代碼沒有問題,但如果可能的話,我想知道如何繪製磚塊。
我附上了一張實際情況的圖片,這個屏障在等待磚頭建成的那一刻是空的,讓它更加可視化。
感謝先進!
如果你能找到一個合適的圖像的例子...... [這個例子]( http://matplotlib.org/examples/pylab_examples/demo_annotation_box.html#pylab-examples-example-code-demo-annotation-box-py)放置在一個圖上的圖像。 – wwii