Problem with Linear Regression Plot

Screen Link:

import matplotlib.pyplot as plt
fig = plt.figure(figsize=(7,15))

ax1 = fig.add_subplot(3, 1, 1)
ax2 = fig.add_subplot(3, 1, 2)
ax3 = fig.add_subplot(3, 1, 3)

train.plot(x="Garage Area", y="SalePrice", ax=ax1, kind="scatter")
train.plot(x="Gr Liv Area", y="SalePrice", ax=ax2, kind="scatter")
train.plot(x="Overall Cond", y="SalePrice",ax=ax3, kind="scatter")

What I expected to happen: I expected to get the same plots as in the answers

What actually happened: I got an error stating that my plot doesn’t match what was expected.

The expected plot is actually same as mine, except that the grid lines are removed and the bckground is white. This is however not possible unless some additional code is applied to remove those features

Hey @TaiwoGoldAyodeji

I was also stuck here very recently.
Just add labels to your plots as the expected plots have it.
This worked for me, you can give it a try.


1 Like

Thanks for your reply. I tried it again without changing anything and it suddenly worked

1 Like