0

I now have three things that I want to plot with matplotlib: the Leistung(blue curve), the meanL(red curve) and the rolmean(yellow curve). The Leistung and the meanL have the same x axis (contains 40200 points), while the rolmean has a different x axis (contains 8000 points). The following is what I have now: enter image description here

What I want to do is to use the upper side of the figure frame as the x axis for rolmean. Is there any way to do that?

Here's the code:

import matplotlib as plt

fig,ax1=plt.subplots()
ax1.plot(Leistung)
ax1.set_xlabel('Messzeiten [s]')
ax1.set_ylabel(r'Leistung $P_1 + P_2 + P_3$ [W]')
ax1.plot(meanL,'r')
ax2=ax1.twinx()
ax2.plot(tmc,rolmean,'orange')

plt.tick_params(direction="in")
plt.tight_layout()
plt.show()
Yingqiang Gao
  • 939
  • 4
  • 16
  • 29

0 Answers0