0

When I use the examples to make a calendar heatmap and run my Python script from the terminal, I see my computer briefly open then close IDLE and the script appears to be finished running.

import numpy as np; np.random.seed(sum(map(ord, 'calplot')))
import pandas as pd
import calplot
import calmap

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)

calplot.calplot(events, cmap='YlGn', colorbar=False) # if I use this or the line above or both the same thing happens
calmap.yearplot(events, year=2019) # if I use this or the line above or both the same thing happens

I have tried installing all of the referenced libraries used by calplot and calmap, and no luck still. I have confirmed I can plot using Matplotlib, so it isn't a graphics issue

Brett
  • 1
  • 1

1 Answers1

0

Calplot uses matplotlib to plot figures. So you can use show() function of matplotlib to show your plotted figures.

import numpy as np; np.random.seed(sum(map(ord, 'calplot')))
import pandas as pd
import calplot
import calmap
import matplotlib.pyplot as plt

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)

calplot.calplot(events, cmap='YlGn', colorbar=False) 

calmap.yearplot(events, year=2019)
plt.show()
jokerdino
  • 2,047
  • 1
  • 25
  • 31