0

I am trying to plot a figure with a particular size. However, when I put the size I wanted the xlabel was cut. How can I fix it? (Also I want to be figure 1 as well)

here is the code:

import numpy as np
import matplotlib.pyplot as plt

y= np.array([[1], [2], [0.5], [1.4],[5], [4], [3.5], [1.2]])
plt.figure(1)
fig = plt.figure(figsize=(4.42, 3.31))
plt.plot(y, marker="o")
x_ticks = np.arange(1, len(y), 5)
plt.xticks(x_ticks)
plt.xlabel("days")
plt.ylabel("percentage(%)")


thanks in advance!

teratoulis
  • 47
  • 5

0 Answers0