For example in ax1 it corresponds to the 1st plot of the figure (index starts at 1 in the upper left corner and increases to the right.)
The arguments correspond to nrows, ncols, index. fig.add_subplot() will be repeated 4 times to correspond to a respective season.
#SCATTER PLOT MATPLOTLIB REMOVE PLOT PROFESSIONAL#
does not clearly show which season had the lowest temperature in comparison.Ĭreating subplots are probably one of the most attractive and professional charting techniques in the industry.shows an overall positive trend between total bike rentals and temperature.hid patterns such as bike rentals increasing in the spring and summer as temperatures rose.did not reveal any discernable differences among the seasonality of bike rentals.However, even after adding these extra layers, the plot can still hide information and be prone to misinterpretation. Now we can distinguish the seasons to check for more underlying information. These 3 arguments are used in tandem to correspond to the location of the legend click on the link at the start of this sentence to find out the nature of these arguments.
scatterpoints are the size of each marker for the scatter plot. The first two arguments are handles: the actual plots to be represented in the legend and labels: the names corresponding to each plot that will be shown in the legend. plt.legend() is where we can pass our arguments to make a legend.marker and color arguments correspond to using a 'o' to visually represent a data point and the respective color of that marker. This is seen again in the data argument in which it has been subsetted to correspond to a single season. There are now 4 plt.scatter() function calls corresponding to one of the four seasons.fontdict for the title, fontdictx for the x-axis and fontdicty for the y-axis. fontdict is a dictionary that can be passed in as arguments for labeling axes.This corresponds to a 15∗10 (length∗width) plot. plt.rcParams = allows to control the size of the entire plot.Plt.ylabel("Count of Total Rental Bikes", fontdict=fontdicty) Plt.xlabel("Normalized temperature", fontdict=fontdictx) Plt.title('Bike Rentals at Different Temperatures\nBy Season', fontdict=fontdict, color="black") Plt.legend(handles=(spring,summer,autumn,winter), Winter = plt.scatter('temp', 'cnt', data=day=4], marker='o', color='blue') Summer = plt.scatter('temp', 'cnt', data=day=2], marker='o', color='orange')Īutumn = plt.scatter('temp', 'cnt', data=day=3], marker='o', color='brown') Spring = plt.scatter('temp', 'cnt', data=day=1], marker='o', color='green')