Skip to content

Instantly share code, notes, and snippets.

@ishritam
Created October 9, 2019 08:10
Show Gist options
  • Save ishritam/2581d4971dbb4974b8e326553a84086e to your computer and use it in GitHub Desktop.
Save ishritam/2581d4971dbb4974b8e326553a84086e to your computer and use it in GitHub Desktop.
1-D scatter plot
#1-D scatter plot of petal-length
import numpy as np
iris_setosa = iris.loc[iris["species"] == "setosa"];
iris_virginica = iris.loc[iris["species"] == "virginica"];
iris_versicolor = iris.loc[iris["species"] == "versicolor"];
plt.plot(iris_setosa["petal_length"], np.zeros_like(iris_setosa['petal_length']), 'o')
plt.plot(iris_versicolor["petal_length"], np.zeros_like(iris_versicolor['petal_length']), 'o')
plt.plot(iris_virginica["petal_length"], np.zeros_like(iris_virginica['petal_length']), 'o')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment