Skip to content

Commit

Permalink
Made gridspec (and hence, summary_plot) optional to support older mat…
Browse files Browse the repository at this point in the history
…plotlib installations.
  • Loading branch information
Chris Fonnesbeck committed Oct 12, 2010
1 parent 4f5fe20 commit 3c3273d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pymc/Matplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

# Import matplotlib functions
import matplotlib
import matplotlib.gridspec as gridspec
try:
import matplotlib.gridspec as gridspec
except ImportError:
gridspec = None
import pymc
import os
from pylab import bar, hist, plot as pyplot, xlabel, ylabel, xlim, ylim, close, savefig
Expand Down Expand Up @@ -950,6 +953,10 @@ def summary_plot(pymc_obj, name='model', format='png', suffix='-summary', path=
"""

if not gridspec:
print '\nYour installation of matplotlib is not recent enough to support summary_plot; this function is disabled until matplotlib is updated.'
return

# Quantiles to be calculated
quantiles = [100*alpha/2, 50, 100*(1-alpha/2)]
if quartiles:
Expand Down

0 comments on commit 3c3273d

Please sign in to comment.