I only just stepped into Python and I'm trying to generate a scatter plot with several categories. I am using the Iris Dataset as a basis, here is what I have so far:
import matplotlib.pyplot as plt
import numpy as np
fig,ax = plt.subplots(1)
iris_data = np.genfromtxt(
"iris.csv", names=True,
dtype="float", delimiter=",")
x=iris_data["sepal_length"]
y=iris_data["sepal_width"]
g=iris_data["class"]
plt.scatter(x,y)
plt.show()
I don't know how to separate out the classes and plot each one on the same graph.
I am coming from Matlab where all I needed was the "gscatter(x,y,g) creates a scatter plot of x and y, grouped by g" to get the job done, but I am finding out that python needs a little more to get the group by g part done.
Thank you in advance for any help.
