P-M*_*P-M 3 matplotlib python-2.7
我正在做一些分析以计算其值为log_10(x)负数。我现在尝试绘制这些值,但是,由于答案的范围非常大,因此我想使用对数标度。如果我只是简单地使用,则会plt.yscale('log')收到一条消息,告诉我UserWarning: Data has no positive values, and therefore cannot be log-scaled.我也无法提供xto 的值,plt.plot因为to 的结果log_10(x)太大且为负数,因此to 的答案x**(log_10(x))很简单0。
绘制此数据最直接的方法是什么?
Imp*_*est 10
您可以使用
plt.yscale('symlog')
Run Code Online (Sandbox Code Playgroud)
将比例设置为对称对数比例。这意味着它将对数缩放到0的两边。仅使用符号对数比例的负数部分就可以了。
| 归档时间: |
|
| 查看次数: |
5510 次 |
| 最近记录: |