有沒有辦法做到這一點?當我嘗試並指定base
或basey
時,hist
命令似乎無法識別它。matplotlib中以2爲底的對數y尺度的直方圖?
3
A
回答
7
注意:下面的解決方案適用於matplotlib版本< 1.3.1。
使用
import numpy as np
import matplotlib.pyplot as plt
mu, sigma = 100, 15
fig, ax = plt.subplots()
x = mu + sigma * np.random.randn(10000)
ax.set_yscale('log', basey=2)
n, bins, histpatches = ax.hist(x, 50, facecolor='green', alpha=0.75)
plt.show()
相關問題
- 1. matplotlib中的背對背直方圖
- 2. 如何在R中爲直方圖的y軸使用對數刻度?
- 3. matplotlib圖,帶2個y軸
- 4. 直方圖Matplotlib
- 5. 散景直方圖對數Y軸上
- 6. Matplotlib直方圖通過常數因子縮放y軸
- 7. Matplotlib堆疊直方圖bin寬度
- 8. 無法在Matplotlib直方圖得到Y軸顯示的概率
- 9. 直方圖與matplotlib
- 10. 在Pandas直方圖中修改y軸matplotlib
- 11. 直方圖matplotlib,文字出直方圖
- 12. 使R中對數刻度直方圖
- 13. 直方圖在多尺度(平均移?)
- 14. 不同尺度的Matplotlib twinx
- 15. matplotlib直方圖與圖例
- 16. 2 Y軸直方圖(正常頻率VS相對頻率)
- 17. 如何有兩個Y尺度在matplotlib同時對x軸的日期
- 18. 在Matplotlib底圖
- 19. 用matplotlib在Python中的三維直方圖的怪異行爲
- 20. matplotlib在xubuntu上的值爲10^-1的stepfilled直方圖中斷
- 21. 圖matplotlib顯示直方圖中的總計數bin
- 22. 對數刻度(x軸)直方圖
- 23. Python Matplotlib直方圖顏色
- 24. Matplotlib直方圖標題
- 25. Python - Matplotlib多直方圖
- 26. 爲matplotlib直方圖公開更新方法的簡單方法
- 27. Y-break與R中的尺度變化
- 28. 3軸上的直方圖-matplotlib python
- 29. matplotlib顏色表的直方圖均衡
- 30. Python/matplotlib在直方圖中顯示置信度
你可以發佈你已經嘗試過? – timss 2013-04-22 13:06:16