0
我有這樣的代碼:如何爲多個子圖創建單個x軸標籤和y軸標籤?
pyplot.figure()
pyplot.suptitle('Finding the roots of the equation: z^4 - 1 = 0')
ticks = [-2.0, -1.0, 0.0, 1.0, 2.0]
pyplot.subplot(221)
pyplot.imshow(roots, extent=(x0, x1, y0, y1))
pyplot.xticks(ticks)
pyplot.yticks(ticks)
pyplot.subplot(222)
pyplot.imshow(iterations, extent=(x0, x1, y0, y1))
pyplot.colorbar(orientation='vertical')
pyplot.xticks(ticks)
pyplot.yticks(ticks)
pyplot.subplot(223)
pyplot.imshow(roots_zoom, extent=(x2, x3, y2, y3))
pyplot.subplot(224)
pyplot.imshow(iterations_zoom, extent=(x2, x3, y2, y3))
pyplot.colorbar(orientation='vertical')
pyplot.show()
我繪製的數字四組在次要情節的一個2x2的人物形象。我需要爲每個標籤和y標籤。如何創建一個以兩個底圖爲中心的x標籤和一個以左兩個圖爲中心的y標籤?
另外,如何將指定的刻度標記更改爲浮點型?我已經創造了他們爲[-2.0 ... 2.0],但他們圖中所示爲-2,-1,0等
歡迎來到SO!你應該問每個線程一個問題。 – tacaswell