简体   繁体   English

matplotlib中的问题散点图

[英]Issue scatter plotting in matplotlib

I run the following code, and get the following error: 我运行以下代码,并得到以下错误:

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

wines = pd.read_csv('Wine.csv')


plt.scatter(wines['alcohol'],wines['hue'],c=wines['class'])
plt.xlabel('alcohol')
plt.ylabel('hue')

plt.show()

And get the following error: 并得到以下错误:

FutureWarning: elementwise comparison failed; FutureWarning:逐元素比较失败; returning scalar instead, but in the future will perform elementwise comparison if self._edgecolors == str('face'): 返回标量,但是如果self._edgecolors == str('face'),将来将执行元素比较:

The graph still shows up, no problem...I'm not sure what is going on. 该图仍然显示出来,没问题...我不确定发生了什么。 Just updated my version of numpy, pandas, and matplotlib to the latest version available through anaconda... 刚刚将numpy,pandas和matplotlib的版本更新为可通过anaconda获得的最新版本...

How do I get rid of this error? 我如何摆脱这个错误? I am not even aware that I am doing any elementwise comparisons... 我什至不知道我在做任何元素比较。

This is not an error. 这不是错误。 It is simply a warning, letting you know that the functionality of some function that was called will change in the future. 这只是一个警告,让您知道被调用的某些功能的功能将来会更改。 In future versions of the library, it will return an array (or numpy Series, or dataframe) instead of a single value (it will perform elementwise operations). 在该库的未来版本中,它将返回一个数组(或numpy Series或数据框),而不是单个值(它将执行逐元素运算)。

It seems like something internal to the scatter() function as opposed to something you called up directly, so perhaps you could bring this to the attention of the developers of matplotlib on their website/github (assuming they are not already aware of it) 似乎是scatter()函数内部的东西,而不是您直接调用的东西,所以也许您可以在其网站/ github上引起matplotlib开发人员的注意(假设他们尚未意识到)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM