Ich vermute das problem ist das Q mir (Stelle: Wert) angezeigt wird, während x nur die Anzahl der Werte ist.
Wie kann ich sagen, dass bei Q nur der Wert geplottet wird?
Code: Alles auswählen
import csv
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
dF = pd.read_csv("Daten_korrigiert.csv", sep=';')
xresult = {}
yresult = {}
Q = {}
P = {}
a = 1000
b = 1.1
c = 12
d=3.6
e=60
for i in range(len(dF.x)-1):
yresult[i] = dF.y[i]
xresult[i] = dF.x[i+1]-dF.x[i]
Q[i]=xresult[i]*a*b*(yresult[i]-c)
P[i]= (Q[i]*d*e)/a
fig = plt.figure()
ax1 = fig.add_subplot(111)
x = np.linspace (1,len(xresult),len(xresult),True)
print x
ax1.plot(x, Q, color='g')
plt.xlabel('Minuten [min]')
plt.ylabel('Q [kW]')
#plt.ylim(0, 3000)
plt.show ()
plt.savefig("Q.jpg")