Skip to content

Instantly share code, notes, and snippets.

@sergiolucero
Created November 28, 2020 22:35
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 sergiolucero/9e066d95f2c56823cced5ef96ebb4ca1 to your computer and use it in GitHub Desktop.
Save sergiolucero/9e066d95f2c56823cced5ef96ebb4ca1 to your computer and use it in GitHub Desktop.
JoyPlot temperaturas máximas Quinta Normal
import pandas as pd
import joypy
import matplotlib.pyplot as plt
df2 = pd.read_excel('EC_series.xlsx')
df2 = df2[df2.mes==11] # November
odf=df2[df2.agno<=1950]
df2 = df2[df2.agno>=1980] # Last 40
# df2.valor -= 23.58 # deviation from the historic November mean
# plt.figure(dpi=380)
fig, axes = joypy.joyplot(df2,by="agno", column="valor",
# ylabels=False, xlabels=False,
grid=False, fill=True,
# background='k',
linecolor="w", linewidth=1,
legend=False, overlap=0.5, figsize=(18,12),kind="counts", bins=10)
for a in axes[:-1]:
a.set_xlim([5,40]) # mean = 26.08
plt.subplots_adjust(left=0, right=1, top=1, bottom=0)
plt.title('Joy Plot temperaturas en Noviembre', fontsize=14, color='grey', alpha=1)
plt.rc("font", size=12)
plt.xlabel('Temperatura Máxima [°C]', fontsize=14, color='grey', alpha=1)
plt.ylabel('Año', fontsize=8, color='grey', alpha=1)
plt.show()
@sergiolucero
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment