In this recipe, we will learn how we can plot 2D data in 3D. We will plot product defects by reason code as a bar plot, and cumulative defects as a line plot. We will have defect reason codes on the x axis, the number of defects on the z axis, and cumulative defect percentage on the y axis. There are kind of two y axes in 2D space, where one of them will have the scale for the bar graph and the other will have the scale for the line graph.
Plotting 2D data in 3D
Getting ready
Import the required libraries:
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D