Customizing Matplotlib Charts

Customizing Matplotlib charts can help make them more readable and attractive. This is especially important when creating data visualizations to share your results.

Essential customizations for your charts are:

  • adding a title
  • adding labels for your x and y axes

Adding a Title to a Matplotlib Chart

  • plt.title(“Housing Prices”)

Adding Labels to X and Y Axes

  • plt.xlabel(“year”)
  • plt.ylabel(“average price”)

Other Customization

There are plenty of other customizations you can make to your plots, but not sure where to include them right now.

One I can show is plt.yticks (and presumably plt.xticks) to manage your x/y illustrations.

  • plt.xticks([‘1970′,’1980′,’1990′,’2000′,’2010’])