我正在寻找一种防止标签重叠的方法。在浏览Stackoverflow时,我甚至找不到任何关于如何控制x轴间距的建议。
matplotlib.pyplot.xticks(x, xticks, rotation=90)
matplotlib.pyplot.plot(x, y)
matplotlib.pyplot.bar(x, y, alpha=0.2)
matplotlib.pyplot.title(
f"średnia cena produktu {self.identifier}, według kontrahentów")
matplotlib.pyplot.xlabel("kontrahent")
matplotlib.pyplot.ylabel("cena")
matplotlib.pyplot.tight_layout()
matplotlib.pyplot.savefig(os.path.join(
"products", self.identifier, "wykres.png"))
matplotlib.pyplot.close()
plt.figure(figsize=(15,5))
来增加图形的大小。 - G. Anderson