matplotlib UserWarning 在某些情况下使用 log 轴时 [英] matplotlib UserWarning When log axis is used in some cases
问题描述
基本上我正在运行一些我使用 Numpy 创建的优化算法,我想根据迭代次数绘制错误日志.通过线性回归完成此操作并且没有任何问题,当使用逻辑回归进行完全相同的事情时,我似乎遇到了问题,这是很奇怪的.我得到以下警告":
Basically I am running some optimisation algorithms that I have created using Numpy and I want to plot the log of the error against the number of iterations. Having done this with linear regression and having had no issues, it is very strange that I seem to get issues when doing the exact same thing with logistic regression. I get the following "warning":
/usr/lib64/python2.6/site-packages/matplotlib/axis.py:1004:用户警告:无法找到间隔沿轴的像素距离填充;假设不需要间隔填充.warnings.warn(无法查找沿轴的像素距离以进行间隔填充;假设没有需要间隔填充.")
/usr/lib64/python2.6/site-packages/matplotlib/axis.py:1004: UserWarning: Unable to find pixel distance along axis for interval padding; assuming no interval padding needed. warnings.warn("Unable to find pixel distance along axis for interval padding; assuming no interval padding needed.")
但是,当我不将对数轴用作y轴时,我也不会收到错误.我正在使用的数组的所有元素也是正数,因此它与取非正数的对数无关.
However, when I don't use a log axis for the y axis, I don't get the error either. All the elements of the array that I am using are also positive, so it shouldn't have anything to do with taking the log of a non-positive number.
有没有人遇到过这种情况?有谁知道它可能指的是什么?
Has anyone ever encountered this before? Does anyone know what it may be referring to?
谢谢
推荐答案
不确定此问题是否仍然存在,但是我遇到了类似的问题,并且更新seaborn为我解决了该问题.对您来说,可能是matplotlib,具体取决于您使用了哪个包来创建图形.
not sure if this issue is still open, but I had a similar problem and updating seaborn fixed the issue for me. For you it might be matplotlib, depending which package you used for creating the graph.
这篇关于matplotlib UserWarning 在某些情况下使用 log 轴时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!