Complete the code to create a secondary y-axis on the right side of the plot.
import matplotlib.pyplot as plt fig, ax = plt.subplots() ax.plot([1, 2, 3], [1, 4, 9]) secax = ax.[1]() plt.show()
The twinx() method creates a secondary y-axis on the right side of the plot.
Complete the code to set the label of the secondary y-axis.
import matplotlib.pyplot as plt fig, ax = plt.subplots() secax = ax.twinx() secax.[1]("Secondary Y") plt.show()
The set_ylabel() method sets the label of the y-axis, including the secondary y-axis.
Fix the error in the code to correctly create a secondary x-axis at the top.
import matplotlib.pyplot as plt fig, ax = plt.subplots() secax = ax.[1]() plt.show()
The twiny() method creates a secondary x-axis at the top of the plot.
Fill both blanks to create a secondary y-axis and set its label.
import matplotlib.pyplot as plt fig, ax = plt.subplots() secax = ax.[1]() secax.[2]("Temperature (°C)") plt.show()
Use twinx() to create the secondary y-axis and set_ylabel() to label it.
Fill all three blanks to create a secondary x-axis at the top, set its label, and plot data on it.
import matplotlib.pyplot as plt fig, ax = plt.subplots() secax = ax.[1]() secax.[2]("Time (s)") secax.[3]([0, 1, 2], [10, 20, 30]) plt.show()
Use twiny() to create the axis at the top, set_xlabel() to label it, and plot() to draw data on it.