gpt4 book ai didi

python - 如何使用 pandas 消除该图中的外部值?

转载 作者:太空宇宙 更新时间:2023-11-03 20:30:03 25 4
gpt4 key购买 nike

from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt



fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

x = power_current_pd8_on['VDD-CL(V)']
y = power_current_pd8_on['CLK_IN(Hz)']
z = IDCLA_pd8_on

ax.scatter(x , y, z, c='r', marker='o')

ax.set_xlabel('VDD-CL(V)')
ax.set_ylabel('CLK_IN(Hz)')
ax.set_zlabel('ID-CL(A)')
ax.set_title('VDD-CL(V) vs CLK-IN(Hz) vs ID-CL(A)')
ax.set_xlim3d(left=.80, right=.9, auto = False)
ax.set_ylim3d(bottom=0, top=.4, auto = False)
#ax.set_zlim3d(0,1000)

plt.show()

我真的不明白我在做什么,因为我已将图表限制为一组特定的参数,但它仍然无法正常工作。我有 6 个这样的图表,但所有下摆都遇到同样的问题。该图表仅限于参数,但有些点离开了图表,我不知道如何修复。

Example plot

最佳答案

您随时可以丢弃不想绘制的数据。

...

x = power_current_pd8_on['VDD-CL(V)']
y = power_current_pd8_on['CLK_IN(Hz)']
z = IDCLA_pd8_on

keepers = (x <= 0.9) & (x >= 0.8) & (y >= 0.0) & (y <= 0.4)

ax.scatter(x[keepers], y[keepers], z[keepers], c='r', marker='o')

...

关于python - 如何使用 pandas 消除该图中的外部值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57564290/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com