Max
Max

Reputation: 347

Matplotlibs pyplot.subplots() crashes kernel

Using matplotlibs pyplot (in this case imported as plt) crashes my kernel (Py3.5 under Win7) when using more than 1 plot. More specifically, the axes obejct results in a crash. The crash is immediatly and killing all running python instances.

E.g. calling

fig,ax = plt.subplots(2,2)

crashes. While

ret = plt.subplots(2,2)
fig = ret[0]

works, and then crashes when calling

ax = ret[1]

or

ax1 = ret[1][0]

or similar

Is this a known issue?

Upvotes: 6

Views: 1644

Answers (1)

RITI
RITI

Reputation: 51

I too faced a similar issue but I could get rid of the crashing problem using this way.

import matplotlib
matplotlib.use("TKAgg")
import matplotlib.pyplot as plt

fig,ax=plt.subplots(1, 1)

This worked for me. Give it a try.

Hope it helps.

Best Wishes

Upvotes: 2

Related Questions