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

Matplotlib Scatter Plot – Tutorial and Examples

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 plot a scatter plot in Matplotlib. Import Data We’ll be using the Ames Housing dataset and visualizing correlations between features from it. Let’s import Pandas and load in the dataset: import pandas as pd df = pd.read_csv(‘AmesHousing.csv’) Plot a Scatter Plot in Matplotlib Now, with […]

Read more

Change Font Size 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 font size in Matplotlib. Change Font Size in Matplotlib There are a few ways you can go about changing the size of fonts in Matplotlib. You can set the fontsize argument, change […]

Read more

Visually Explained: How Can Executives Grasp What Programming Is All About?

Quite often, non-technical executives have difficulties understanding what programming, on a very fundamental level, is all about. Because of that knowledge-gap, they tend to hire and overburden experienced data professionals with tasks which they are hopelessly overqualified for. Such as, for example, doing ad-hoc SQL queries on CRM data: “You’re the go-to-guy for all things data, and we need the results for the board meeting tomorrow.” That’s a quite humbling and frustrating experience for anyone who calls himself a Data […]

Read more

Add Legend to Figure in Matplotlib

Introduction Matplotlib is one of the most widely used data visualization libraries in Python. Typically, when visualizing more than one variable, you’ll want to add a legend to the plot, explaining what each variable represents. In this article, we’ll take a look at how to add a legend to a Matplotlib plot. Creating a Plot Let’s first create a simple plot with two variables: import matplotlib.pyplot as plt import numpy as np fig, ax = plt.subplots() x = np.arange(0, 10, […]

Read more

Save Plot as Image with Matplotlib

Introduction Matplotlib is one of the most widely used data visualization libraries in Python. It’s common to share Matplotlib plots and visualizations with others. In this article, we’ll take a look at how to save a plot/graph as an image file using Matplotlib. Creating a Plot Let’s first create a simple plot: import matplotlib.pyplot as plt import numpy as np x = np.arange(0, 10, 0.1) y = np.sin(x) plt.plot(x, y) plt.show() Here, we’ve plotted a sine function, starting at 0 […]

Read more

Change Figure Size 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 a figure size in Matplotlib. Creating a Plot Let’s first create a simple plot in a figure: import matplotlib.pyplot as plt import numpy as np x = np.arange(0, 10, 0.1) y = np.sin(x) […]

Read more
1 2 3