def plotData(inData, color):
    x, y = zip(*inData)
xMap = assignIDs(x)
xAsInts = [xMap[i] for i in x]
plt.scatter(xAsInts, y, color=color)
plt.xticks(list(xMap.values()), list(xMap.keys()))
DATA = [('a', 4), ('b', 5), ('c', 5), ('d', 4), ('e', 2), ('f', 5)]
DATA2 = [('a', 3), ('b', 4), ('c', 4), ('d', 3), ('e', 1), ('f', 4), ('a', 
    5), ('b', 7), ('c', 7), ('d', 6), ('e', 4), ('f', 7)]
plotData(DATA, 'blue')
plotData(DATA2, 'red')
plt.gcf().savefig('correlation.png')
Рисование корреляционного графика в matplotlib