0
我正在用matplotlib和seaborn繪製一些傳遞函數。用matplotlib製作清醒地塊
這就是我正在做的地塊至今格式:
它被莫名其妙地亂了,我會更喜歡做類似這樣的情節:
垂直顯示y標籤Vo/Vi,行tt他結束了軸,只顯示曲線的峯值。
matplotlib或seaborn中有預設樣式來獲得這種情節?
我正在用matplotlib和seaborn繪製一些傳遞函數。用matplotlib製作清醒地塊
這就是我正在做的地塊至今格式:
它被莫名其妙地亂了,我會更喜歡做類似這樣的情節:
垂直顯示y標籤Vo/Vi,行tt他結束了軸,只顯示曲線的峯值。
matplotlib或seaborn中有預設樣式來獲得這種情節?
下面應該工作:
import matplotlib.pyplot as plt
x = [0, 1, 2, 3]
y = [0, 1, 2, 3]
plt.plot(x, y)
plt.ylabel('$\\frac{V_i}{V_o}$', rotation=0, size=25)
plt.xlabel('$D$')
ax = plt.gca()
ax.set_yticks([max(y)])
ax.set_xticks([max(x)])
plt.hlines([max(y)], 0 ,max(x), linestyles='--')
plt.vlines([max(x)], 0, max(y), linestyles='--')
plt.axis([0, 4, 0, 4])
plt.show()
要使用plt.gca()。spin ['top']。set_visible(False) – Andi
沒有在規定的解決方案,但你可以使用相同的方法從這裏:http://stackoverflow.com/a/17690294/1867876 –