2

I'm trying to recreate a graph from a professor's example. This is what he did:

axes = sns.regplot(x=miami.Date, y=miami.Temperature)
from matplotlib import pyplot as plt
plt.title('Regression analysis of Miami Temps')

but when I do it the graph looks weird, it comes out like this:

Graph from matplotlib and seaborn

Why are the data points like this and how do I make it so that it looks normal (so they aren't only on the far left and right)?

This is the desired enter image description here

Ryan
  • 21
  • 3
  • 1
    You might want to add an image of your expected plot so people can see the discrepancy. – ShlomiF Apr 17 '21 at 19:39
  • 2
    Please provide a [mre] including input (data), complete code, and expected output. – wjandrea Apr 17 '21 at 19:42
  • desired plot added – Ryan Apr 17 '21 at 19:47
  • Your 'Date' column isn't in a nice date format. Did you read your data with `read_csv()`? See e.g. [Can pandas automatically recognize dates?](https://stackoverflow.com/questions/17465045/can-pandas-automatically-recognize-dates) – JohanC Apr 17 '21 at 21:45

0 Answers0