goglforum.blogg.se

Matplotlib scatter
Matplotlib scatter









matplotlib scatter

scatter ( temperature_2009, temperature_2010 ) plt. QUOTE_NONNUMERIC ) temperature_2010 = for x in csv_reader ] plt. QUOTE_NONNUMERIC ) temperature_2009 = for x in csv_reader ] with open ( "2010-temp-daily.csv" ) as csv_file : csv_reader = csv. Import matplotlib.pyplot as plt import csv with open ( "2009-temp-daily.csv" ) as csv_file : csv_reader = csv. We wouldn't expect an exact correlation, because individual days will vary, and there is no reason to expect the daily variations to be exactly replicated the following year. This is not surprising, the days at any particular time of year will tend to be broadly similar from one year to the next (it is usually col din January, for example). Here is the result:Īs you might expect, there is some correlation between the temperatures in 2009 and the temperatures in 2010. We can try an alternative scatter graph, based on the daily temperatures of 2009 versus the daily temperatures of 2010. Scatter graph of temperatures for different years In this code, we read in the two data series, and use plt.scatter to plot the graph. title ( "Temperature vs rainfall 2009" ) plt. QUOTE_NONNUMERIC ) rain = for x in csv_reader ] plt. QUOTE_NONNUMERIC ) temperature = for x in csv_reader ] with open ( "2009-rain-daily.csv" ) as csv_file : csv_reader = csv.

matplotlib scatter

That is as expected, it cannot get really hot on a cloudy day, and it cannot rain much unless there are plenty of clouds. The only real correlation is that there on the hottest days (when the temperature is above 23 degrees) there is never much rain. In the UK it can rain on warm days or cold days, as anyone who lives there will tell you. The points cover almost all of the area, which tells us that there is very little correlation between rainfall and temperature. The set of dots indicates any general trend or relationship between temperature and rainfall. The overall graph doesn't give any indication of which day each dot represents. The position of the dot shows the temperature and rainfall for that day. In this graph, each dot represents a single day of the year. Here is a scatter graph of the daily temperature and rainfall for 2009:

  • The correlation between temperature and season.
  • The correlation between temperatures in 2 different years.
  • The correlation between temperature and rainfall.
  • matplotlib scatter

    A scatter graph is used to show the correlation between 2 data series.











    Matplotlib scatter