I want to plot two data point categories in the same matplotlib plot using two different colours.
Following code plot one category of data points with labels.
import matplotlib
import pylab as plt
x = [-0.39615277,-0.31426806,-0.17823952,-0.43836375,-0.26388058,-0.52400482, -0.26388058, -0.32637322]
y = [0.28005737,0.44953214, 0.26899154, 0.36850831, -0.34592143, -0.24640466, -0.34592143, -0.45966878]
n=['romeo','juliet','happy','dagger','live','die','free','hampshier']
fig, ax = plt.subplots()
ax.scatter(x, y)
for i, txt in enumerate(n):
ax.annotate(txt, (x[i],y[i]))
matplotlib.pyplot.show()
But I have following data set which has to be plotted in the same figure with a different colour.
x1 = [-0.31086574,-0.40733041,-0.59446137,-0.60304575,-0.1428143]
y1 = [0.36293322,0.54074246, 0.20005441, -0.6953914, -0.22866156]
n1=['d1','d2','d3','d4','d5']
How to achieve this?
