How to Change Plot Background in Matplotlib

Introduction Matplotlib is one of the most widely used data visualization libraries in Python. From simple to complex visualizations, it’s the go-to library for most. In this tutorial, we’ll take a look at how to change the background of a plot in Matplotlib. Importing Data and Libraries Let’s import the required libraries first. We’ll obviously need Matplotlib, and we’ll use Pandas to read the data: import matplotlib.pyplot as plt import pandas as pd Specifically, we’ll be using the Seattle Weather […]

Read more

Rotate Axis Labels in Matplotlib

Introduction Matplotlib is one of the most widely used data visualization libraries in Python. Much of Matplotlib’s popularity comes from its customization options – you can tweak just about any element from its hierarchy of objects. In this tutorial, we’ll take a look at how to rotate axis text/labels in a Matplotlib plot. Creating a Plot Let’s create a simple plot first: import matplotlib.pyplot as plt import numpy as np x = np.arange(0, 10, 0.1) y = np.sin(x) plt.plot(x, y) […]

Read more

How to Plot Inline and With Qt – Matplotlib with IPython/Jupyter Notebooks

Introduction There are a number of different data visualization libraries for Python. Out of all of the libraries, however, Matplotlib is easily the most popular and widely used one. With Matplotlib you can create both simple and complex visualizations. Jupyter notebooks are one of the most popular methods of sharing data science and data analysis projects, code, and visualization. Although you may know how to visualize data with Matplotlib, you may not know how to use Matplotlib in a Jupyter […]

Read more

Change Tick Frequency in Matplotlib

Introduction Matplotlib is one of the most widely used data visualization libraries in Python. Much of Matplotlib’s popularity comes from its customization options – you can tweak just about any element from its hierarchy of objects. In this tutorial, we’ll take a look at how to change the tick frequency in Matplotlib. We’ll do this on the figure-level as well as the axis-level. How to Change Tick Frequency in Matplotlib? Let’s start off with a simple plot. We’ll plot two […]

Read more

Seaborn Scatter Plot – Tutorial and Examples

Introduction Seaborn is one of the most widely used data visualization libraries in Python, as an extension to Matplotlib. It offers a simple, intuitive, yet highly customizable API for data visualization. In this tutorial, we’ll take a look at how to plot a scatter plot in Seaborn. We’ll cover simple scatter plots, multiple scatter plots with FacetGrid as well as 3D scatter plots. Import Data We’ll use the World Happiness dataset, and compare the Happiness Score against varying features to […]

Read more

How to Set Axis Range (xlim, ylim) in Matplotlib

Introduction Matplotlib is one of the most widely used data visualization libraries in Python. Much of Matplotlib’s popularity comes from its customization options – you can tweak just about any element from its hierarchy of objects. In this tutorial, we’ll take a look at how to set the axis range (xlim, ylim) in Matplotlib, to truncate or expand the view to specific limits. Creating a Plot Let’s first create a simple plot: import matplotlib.pyplot as plt import numpy as np […]

Read more
1 2 3