Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created May 18, 2021 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/e282dfab6036d8a9caaf1a0c9f23f1c1 to your computer and use it in GitHub Desktop.
Save amankharwal/e282dfab6036d8a9caaf1a0c9f23f1c1 to your computer and use it in GitHub Desktop.
# Scatter Plot
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
housing = pd.read_csv("https://raw.githubusercontent.com/ageron/handson-ml/master/datasets/housing/housing.csv")
housing.plot(kind='scatter', x='longitude', y='latitude', alpha=0.4, s=housing['population']/100, label='population',
figsize=(12, 8), c='median_house_value', cmap=plt.get_cmap('jet'), colorbar=True)
plt.legend()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment