1
A
回答
2
在這裏你去
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
x = np.linspace(-np.pi, np.pi, 100)
y = 2*np.sin(x)
ax = fig.add_subplot(111)
ax.set_title('centered spines')
ax.plot(x, y)
ax.spines['left'].set_position('center')
ax.spines['right'].set_color('none')
ax.spines['bottom'].set_position('bottom')
ax.spines['top'].set_color('none')
ax.spines['left'].set_smart_bounds(True)
ax.spines['bottom'].set_smart_bounds(True)
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
更多的例子:http://matplotlib.org/examples/pylab_examples/spine_placement_demo.html
相關問題
- 1. matplotlib boxplot xticks向y軸移動
- 2. 在Y軸上移動UIButton
- 3. Matplotlib標籤y軸
- 4. matplotlib組Y軸蜱
- 5. Matplotlib指示點在X軸和Y軸
- 6. 使用translateX()在X軸上移動,它也移動Y軸
- 7. matplotlib自動縮放(軸= 'Y')與set_xlim()
- 8. Python-Matplotlib將圖形標題移動到y軸
- 9. AChartEngine - 移動Y軸標題?
- 10. 輔助Y軸位置matplotlib
- 11. matplotlib圖,帶2個y軸
- 12. 在Matplotlib中移動x或y刻度
- 13. 在MATLAB中在y軸上移動圖
- 14. Python中,Matplotlib定製軸共享Y軸
- 15. Matplotlib:緊定軸只有X或Y軸
- 16. 在matplotlib中移動座標軸文本
- 17. 移動一個UIImageView在Y軸
- 18. 在Unity中預防Y軸移動`transform.forward`
- 19. 在matplotlib中向x y軸添加偏移量
- 20. 如何在matplotlib/python中縮小y軸?
- 21. 在matplotlib中設置y軸限制
- 22. 在matplotlib中創建兩個y軸線
- 23. Matplotlib - 固定x軸縮放和自動縮放y軸
- 24. matplotlib:如何讓y軸的列表長度爲自動x軸
- 25. Matplotlib根據手動縮放的x軸縮放y軸
- 26. 如何在matplotlib中自動調整y軸?
- 27. 重疊y軸刻度標籤和x軸在matplotlib
- 28. matplotlib imshow - 利用矩陣爲y軸值
- 29. Matplotlib:多種顏色的y軸標籤
- 30. matplotlib:爲什麼我的Y軸扭曲?
plt.xlim([0,10]) – kaminsknator
我想這樣做,但又不失左側部分。 ps:圖像未加載:( – sandiego206