我有1个y变量和数百个X变量,我想通过for循环创建散点图。我有代码,让我生成的情节,但我需要x, y标签相应标记以及。我怎么能这样做呢?如有任何帮助,不胜感激。
代码如下:
figures = []
for column in X_uni:
f = plt.figure(figsize=(6,6))
figures += [f] # This appends a figure f to the list of figures
ax = plt.axes()
ax.plot(X_uni[column], y_data, marker = 'o', ls='', ms = 3.0)
使用
ax.set_xlabel(column)
在你的for循环。并添加ylabel:
ax.set_ylabel("ylabel")