Matplotlib

How to Plot the Confidence Interval in Python?

Problem Formulation: How to plot the confidence interval in Python? To plot a filled interval with the width ci and interval boundaries from y-ci to y+ci around function values y, use the plt.fill_between(x, (y-ci), (y+ci), color=’blue’, alpha=0.1) function call on the Matplotlib plt module. The first argument x defines the x values of the filled …

How to Plot the Confidence Interval in Python? Read More »

How to Plot Matplotlib’s Color Palette — and Choose Your Plot Color?

In this article, we’ll learn how to generate the matplotlib color palette and then we will use it to select a specific color for our plot. When presenting data, the color that you assign to a plot is very important; a bad color choice can make your data difficult to understand or even less interesting. …

How to Plot Matplotlib’s Color Palette — and Choose Your Plot Color? Read More »

How to Calculate Percentiles in Python

This article deals with calculating percentiles. Percentiles are statistical indicators that are used to describe specific portions of a sample population. The following sections will explain what percentiles are, what they are used for and how to calculate them, using Python. As you will see, Python allows solving this problem in multiple ways, either by …

How to Calculate Percentiles in Python Read More »

Matplotlib Cursor — How to Add a Cursor and Annotate Your Plot

This article explains how to insert a cursor to your plot, how to customize it and how to store the values that you selected on the plot window. In lots of situations we may want to select and store the coordinates of specific points in our graph; is it just for assessing their value or …

Matplotlib Cursor — How to Add a Cursor and Annotate Your Plot Read More »

Matplotlib Widgets — How to Make Your Plot Interactive With Buttons

This article presents different types of widgets that can be embedded within a matplotlib figure, in order to create and personalize highly interactive plots. Exploiting the matplotlib package .widget(), it is hence possible to create personalized buttons that allows controlling different properties of the graphs that are plotted in the main window. This represents a …

Matplotlib Widgets — How to Make Your Plot Interactive With Buttons Read More »

Matplotlib Widgets — Creating Interactive Plots with Sliders

This article describes how to generate interactive plots by using the .widgets package from the matplotlib library. As can be inferred from the name, the .widgets package allows creating different types of interactive buttons, which can be used for modifying what is displayed in a matplotlib graph. In particular, this article will focus on the …

Matplotlib Widgets — Creating Interactive Plots with Sliders Read More »

Creating Beautiful Heatmaps with Seaborn

Heatmaps are a specific type of plot which exploits the combination of color schemes and numerical values for representing complex and articulated datasets. They are largely used in data science application that involves large numbers, like biology, economics and medicine. In this video we will see how to create a heatmap for representing the total …

Creating Beautiful Heatmaps with Seaborn Read More »

Matplotlib Line Plot – A Helpful Illustrated Guide

The line plot is the most iconic of all the plots. To draw one in matplotlib, use the plt.plot() function and pass it a list of numbers used as the y-axis values. Per default, the x-axis values are the list indexes of the passed line. Matplotlib automatically connects the points with a blue line per …

Matplotlib Line Plot – A Helpful Illustrated Guide Read More »

Matplotlib Scatter Plot – Simple Illustrated Guide

Scatter plots are a key tool in any Data Analyst’s arsenal. If you want to see the relationship between two variables, you are usually going to make a scatter plot.  In this article, you’ll learn the basic and intermediate concepts to create stunning matplotlib scatter plots. Minimal Scatter Plot Example The following code shows a …

Matplotlib Scatter Plot – Simple Illustrated Guide Read More »

np.polyfit() — Curve Fitting with NumPy Polyfit

The .polyfit() function, accepts three different input values: x, y and the polynomial degree. Arguments x and y correspond to the values of the data points that we want to fit, on the x and y axes, respectively. The third parameter specifies the degree of our polynomial function. For example, to obtain a linear fit, …

np.polyfit() — Curve Fitting with NumPy Polyfit Read More »