In this recipe, we will learn how to plot a bar graph in 3D. We will use the battery sales data that we used for table plotting in Chapter 2, Getting Started with Basic Plots. Here, we will only plot a bar chart, not the table chart, below the bar graph.
Bar plot
Getting ready
Import the required libraries:
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
How to do it...
The following are the steps to implement the logic:
- Define the figure and axes for 3D plotting:
fig = plt.figure(figsize=(10,6))
ax = fig.add_subplot(111, projection...