Skip to content

Instantly share code, notes, and snippets.

@Sn3akyP3t3
Created April 9, 2021 15:53
Show Gist options
  • Save Sn3akyP3t3/dda6bf6ae9e0128e21bcd5d4488ade50 to your computer and use it in GitHub Desktop.
Save Sn3akyP3t3/dda6bf6ae9e0128e21bcd5d4488ade50 to your computer and use it in GitHub Desktop.
import calplot
import numpy as np
import pandas as pd
all_days = pd.date_range('1/1/2019', periods=730, freq='D')
days = np.random.choice(all_days, 500)
events = pd.Series(np.random.randn(len(days)), index=days)
plot = calplot.calplot(events)
print(type(plot[0])) # reveals <class 'matplotlib.figure.Figure'>
print(type(plot[1])) # reveals <class 'numpy.ndarray'>
# So this should reveal the figure then, but it shows a white box that quickly closes
plot[0].show()
@Sn3akyP3t3
Copy link
Author

Found the solution shortly after posting my question.

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