当前位置:   article > 正文

pythonxlabel位置_Python类型错误:xlabel()缺少1个必需的位置参数:“s”

xlabel() missing 1 required positional argument: 'xlabel

import os, pandas as pd

from matplotlib import pyplot

import matplotlib.pyplot as plt

#Change this to match your directory where the file is stored

os.chdir(r'Z:\\My Documents')

#Read the CSV into Python, setting the first column as the index and the first row as the column names

series = pd.read_csv('Energy.csv', header=0,index_col = 0)

series = series.transpose()

x = series.columns

print(series.head())

name = series.index.values

plt.figure(figsize = (11.69,8.27))

for i,values in enumerate(series.values):

plt.bar(x,values, label = name[i])

plt.xlabel(label = "VOC", loc = 'best')

plt.ylabel(label = "VOC", loc = 'best')

plt.legend(loc = 'best')

大家好

我试着运行上面的代码,它一直在说:

^{pr2}$

我移动了位置论证,但它仍然抛出错误。在

有什么想法吗?在

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/669698
推荐阅读
相关标签
  

闽ICP备14008679号