Let’s try changing the titles to make it a little prettier: plt.scatter(x=df, y=df,marker='o') We can change the font size of the title and axis labels by passing in the fontsize= argument into the respective functions. Let’s add some descriptive titles to our chart: plt.scatter(x=df, y=df,marker='o')
If you want to change your marker, you can choose from the following markers: available_markers = How to add titles and axis labels to Matplotlib scatter charts?Īdding titles and axis labels to Matplotlib scatter charts can be done using the. This is just one of many markers that are available. Let’s give this a shot: plt.scatter(x=df, y=df,marker='o') You can then use x= and y= arguments to pass in data and the marker= argument to set what type of marker you want to use. scatter() function to create scatterplots. Printing out the head of the dataframe returns the following: ID Year Age Team Minutes Composite_Rating WinsĠ montgre01w 2019 32 Atlanta 949 -2.4 1.22ġ williel01w 2019 26 Atlanta 909 0.6 2.51Ģ sykesbr01w 2019 25 Atlanta 880 -3.4 0.70ģ hayesti01w 2019 29 Atlanta 817 -1.5 1.45Ĥ brelaje01w 2019 31 Atlanta 767 -0.8 1.62 How to create Matplotlib scatter charts? Usecols = ĭf = df.str.replace('ATL', 'Atlanta')ĭf = df.str.replace('CHI', 'Chicago') The dataset contains quite a bit of data and the headers aren’t the clearest, so we’ll do a little bit of cleaning up. Let’s also import a dataset from Five Thirty Eight in regards to WNBA scores, which you can find here. How to add a style to Matplotlib charts?įor this tutorial, we’re going to use Pandas and Matplotlib.
How to change marker size in Matplotlib scatter charts?.How to add a legend to Matplotlib scatter charts?.How to customize scatter marker colours?.How to add titles and axis labels to Matplotlib scatter charts?.How to create Matplotlib scatter charts?.