出于某种原因,这不能保存我的情节。它只显示它。
import pandas as pd
import matplotlib.pyplot as plt
import pandas
df = pandas.read_csv("volvo_volvo.csv");
dfw = pandas.DataFrame(data = df, columns=['PriceDisplay','Year','Odometer'])
y = df.PriceDisplay.values
x = df.Odometer.values
plt.scatter(x,y,linewidth=2)
plt.show()
fig.savefig('fig2.png')