- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
切换到新系统后,我遇到了 matplotlib
的奇怪错误。我正在尝试创建一个 r 轴反转的极坐标图。因此,在我的情况下,从 90 运行到 0。这在我以前的系统上运行良好,具有最小的工作示例:
import matplotlib.pyplot as plt
from random import randint
fig, ax = plt.subplots(subplot_kw=dict(projection='polar'))
plt.scatter([randint(0, 360)], [randint(0, 90)])
ax.set_rlim(90, 0)
ax.set_theta_zero_location('N')
ax.set_theta_direction('clockwise')
plt.show()
在我的新系统上运行产量
posx and posy should be finite values
posx and posy should be finite values
/usr/local/lib/python3.5/dist-packages/numpy/core/fromnumeric.py:83: RuntimeWarning: invalid value encountered in reduce
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values
到目前为止,我发现错误是由包含 ax.set_rlim(90, 0)
的行中的反转 r 轴触发的(使用 ax.set_rlim(0, 90)
工作正常)。
我的系统设置是
旧系统非常相似,我无法恢复使用过的版本。这是新版本中的一些已知错误吗?我找不到与极坐标图有关的与此错误消息相关的任何信息。
最佳答案
我现在通过将标签更改为从 90 到 0 的范围来做一个相当草率的解决方法
ticklabels = ax.get_yticklabels()
labels = range(80, 0, -10)
for i in range(0, len(labels)):
ticklabels[i] = str(labels[i])
ax.set_yticklabels(ticklabels)
所有半径值也必须相应调整。在这种情况下,90 - r_value 才能正确显示。
关于Python - matplotlib 极坐标图问题 - "posx and posy should be finite values",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51610595/
切换到新系统后,我遇到了 matplotlib 的奇怪错误。我正在尝试创建一个 r 轴反转的极坐标图。因此,在我的情况下,从 90 运行到 0。这在我以前的系统上运行良好,具有最小的工作示例: imp
我正在使用 translate3d(..., ..., 0px) 进行自定义拖放,出于某些原因,我需要使用 Javascript 获取位置 X 和位置 Y,只是就像下面的例子。 transform:
如果我假设背景位置将始终采用以下格式: 0px 0px;或 10px 11px; 所以,*number*px *number*px. 如何在 Javascript 中同时获取 x 位置和 y 位置?
问题 所以我有一个 6 层 (array.size = (192,288,6)) 的经纬度数组,其中包含一堆数据,其值范围接近 0 到大约 0.65。当我绘制来自 6 层([:,:,0]、[:,:,1
我解决了在stackoverflow上找不到的问题,因此我决定将其上传给遇到此错误的其他人。 我有一组功能可以从不同的情节创建视频。我用它来举例说明位置([X Y]坐标)如何随时间变化。 在我的一个绘
这个问题在这里已经有了答案: Syntax error due to using a reserved word as a table or column name in MySQL (1 个回答)
我是一名优秀的程序员,十分优秀!