我正在使用matplotlib在电压VAC上绘制当前IC [见下面的值],并且在线性轴上绘制完全正常:
但是当使用而不是plt.plot plt.semilogy时,会发生以下情况:
不知道为什么曲线的某些部分缺失,这是我的代码:
import numpy as np
import matplotlib.pyplot as plt
import struct as stc
plt.semilogy(VAC,IA) #first one uses plt.plot
plt.xlabel('time (s)')
plt.ylabel('voltage (mV)')
plt.title('About as simple as it gets, folks')
plt.grid(True)
plt.show()
IA=['0.3112E-04', '0.7237E-06', '0.1667E-07', '0.3896E-09', '0.0000E+00', '-0.1358E-12', '0.7944E-13', '0.4032E-12', '-0.2565E-13', '0.4066E-12', '0.0000E+00', '0.3893E-09', '0.1198E-08', '0.3699E-08', '0.1667E-07', '0.5165E-07', '0.1601E-06', '0.7237E-06', '0.2243E-05', '0.6943E-05', '0.3112E-04', '0.9462E-04', '0.2795E-03', '0.1081E-02', '0.2711E-02', '0.6283E-02', '0.1754E-01', '0.3596E-01', '0.7095E-01', '0.1638E+00', '0.2868E+00', '0.4603E+00', '0.4930E+00']
VAC=['0.6000E+00', '0.5000E+00', '0.4000E+00', '0.3000E+00', '0.0000E+00', '-0.4000E+00', '-0.7000E+00', '-0.1000E+01', '-0.7000E+00', '-0.4000E+00', '0.0000E+00', '0.3000E+00', '0.3300E+00', '0.3600E+00', '0.4000E+00', '0.4300E+00', '0.4600E+00', '0.5000E+00', '0.5300E+00', '0.5600E+00', '0.6000E+00', '0.6300E+00', '0.6600E+00', '0.7000E+00', '0.7300E+00', '0.7600E+00', '0.8000E+00', '0.8300E+00', '0.8600E+00', '0.9000E+00', '0.9300E+00', '0.9600E+00', '0.1000E+01']
非常感谢你们!
答案 0 :(得分:0)
好的,我知道了,这是负值,你不能把它放到log(x)中。