Plot Multiple Graphics in the Same Figure Using Python
Learn how to plot multiple graphics in the same matplotlib figure

If you work with Jupyter Notebooks, you know that the right side of it becomes really low populated when it comes to graphics. That happens because you usually create one graphic by cell and it does not take more than half of your screen.
However, sometimes it is necessary to plot two graphics side-by-side, not only for the sake of better space utilization, but mainly because we, as Data Scientists, frequently need to compare plots.
Let’s say you’re analyzing the distribution of trips of a Taxi company and you want to know what’s the difference in terms of distance between trips with the pickup happening in Manhattan versus Brooklyn.
Let’s load the dataset. I will use one of the sample datasets from seaborn
package called Taxis. You can load it after importing seaborn.
import seaborn as sns# Load dataset
df = sns.load_dataset('taxis')

Then let’s isolate the travels initiating in Manhattan and Brooklyn.