In this recipe, we will learn to plot a scatter graph on the main axes and create a histogram of each of the two variables on the two inset axes. We will use the familiar Iris dataset to do this.
Using inset_locator to plot inset axes
Getting ready
You'll need to import the required libraries using the following commands:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
How to do it...
Here is the step-by-step approach to plotting our graph:
- Load the Iris dataset and map the x and y coordinates...