Created
May 5, 2020 20:20
-
-
Save sergiolucero/22ba0b79b729420362a250aec81fd9a1 to your computer and use it in GitHub Desktop.
Lines over Heatmap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import seaborn as sns; sns.set() | |
import matplotlib.pyplot as plt | |
flights = sns.load_dataset("flights");flights = flights.pivot("month", "year", "passengers") | |
fig, ax = plt.subplots(1, figsize=(16,8)) | |
sns.heatmap(flights, cbar=False, annot=True, fmt='.0f', ax=ax) | |
for ix in range(12): # one per height | |
x = range(12); y = ix+1-flights.iloc[ix]/flights.iloc[ix].max() | |
h = plt.plot(x,y, lw=4) | |
plt.show() |
Author
sergiolucero
commented
May 5, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment