Getting ready
We will use product defects data in a manufacturing plant for a given month. It has a defect reason code and a number of defects. So, we will plot a bar graph for the number of defects by the defect reason code, and a line plot for cumulative defects as a percentage of the total defects. Obviously, the range of data for number of defects and cumulative percentage will vary significantly, so a common y axis does not give the right picture of data. Twinning the axes comes to the rescue in such situations.
We will plot two different plots; one using twinx() and the other using twiny() in this section. We will learn how to plot the third option of no sharing of any axis in the There's more... section of this recipe.
Import the required ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access