2024-04-18 23:40:53 发布
网友
所以我想画出均衡器抽头的振幅,像这样:
但是我所有的均衡器抽头振幅都是-dBc(负dB载波)。我当前的代码如下所示:
self.ui.mplCoeff.canvas.ax.clear() rect = 1,24,-100,0 self.ui.mplCoeff.canvas.ax.axis(rect) self.ui.mplCoeff.canvas.ax.bar(tapIndices,tapAmplitudedBc)
结果如下所示,基本上和我需要的相反。有人有线索吗?你知道吗
让我先用一些示例数据创建一些类似于您的绘图的内容:
import numpy as np import matplotlib.pyplot as plt x = np.arange(11) y = - x**2 plt.bar(x, y)
这将产生以下图像:
现在可以使用^{}的bottom参数将图像转换为所需的图像:
bottom
plt.bar(x, 100 + y, bottom = -100) # or, more general: # plt.bar(x, -m + y, bottom = m) # where m is the minimum value of your value array, m = np.min(y)
塔达:
让我先用一些示例数据创建一些类似于您的绘图的内容:
这将产生以下图像:
现在可以使用^{} 的
bottom
参数将图像转换为所需的图像:塔达:
相关问题 更多 >
编程相关推荐