Code: Alles auswählen
import os
import csv
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl #Add "as mpl" for command in line 36
import pylab as py
import xlsxwriter
histNumBins = 150
histAxisMin = 0
histAxisMax = 0,6
#------------------------------------------------------------------------------------
#Draw histogram
#------------------------------------------------------------------------------------
fig = plt.figure()
ax1 = fig.add_subplot(111)
histIntra = ax1.hist(intraData, histNumBins, range = [histAxisMin, histAxisMax], label = "ID", facecolor = "b")
ax1.set_xlabel("HD")
ax1.set_ylabel("EA")
ax1.set_ylim([0, len(iData)])
ax1.tick_params("y", colors = "b")
ax1.grid()
x = np.linspace(histAxisMin, histAxisMax, 500)
yAx1 = gaussFunc(x, max(histI[0]), iMean, iStd)
#plt.plot(x, yAx1, color="orange")
ax2 = ax1.twinx()
histE = ax2.hist(eData, histNumBins, range = [histAxisMin, histAxisMax], label = "ID", facecolor = "g")
ax2.set_ylabel("EA2")
ax2.tick_params("y", colors = "g")
yAx2 = gaussFunc(x, max(histE[0]), eMean, eStd)
plt.plot(x, yAx2, color="orange")
Viele Grüße
cyc7