0

I am trying to make a Python plot with labels on both the right and left sides on the vertical axis. However, I cannot manage to get a label on the bottom of the horizontal axis. Can anyone help me, please?

I have made this code, and it works fine, except I can't find a way to get an x-label:

from matplotlib import pyplot as plt
import numpy as np

fig, y1 = plt.subplots()
y2 = y1.twinx()

x = np.linspace(0,10,10)

f1 = x*2
plt.plot(x,f1)
f2 = x*3
plt.plot(x,f2)
f3 = x*4
plt.plot(x,f3)

y1.set_ylabel('y1')
y2.set_ylabel('y2')

enter image description here

Kevin
  • 1
  • 1

0 Answers0