|
1 |
| -from matplotlib import gridspec |
2 |
| -import matplotlib.pyplot as plt |
| 1 | +try: |
| 2 | + import matplotlib.pyplot as plt |
| 3 | + from matplotlib import gridspec |
| 4 | +except ImportError: # mpl is optional |
| 5 | + pass |
3 | 6 | import numpy as np
|
4 | 7 | from pymc3.diagnostics import gelman_rubin
|
5 | 8 | from pymc3.stats import quantiles, hpd
|
@@ -102,18 +105,18 @@ def _plot_tree(ax, y, ntiles, show_quartiles, plot_kwargs):
|
102 | 105 | if show_quartiles:
|
103 | 106 | # Plot median
|
104 | 107 | ax.plot(ntiles[2], y, color=plot_kwargs.get('color', 'blue'),
|
105 |
| - marker=plot_kwargs.get('marker', 'o'), |
106 |
| - markersize=plot_kwargs.get('markersize', 4)) |
| 108 | + marker=plot_kwargs.get('marker', 'o'), |
| 109 | + markersize=plot_kwargs.get('markersize', 4)) |
107 | 110 | # Plot quartile interval
|
108 | 111 | ax.errorbar(x=(ntiles[1], ntiles[3]), y=(y, y),
|
109 |
| - linewidth=plot_kwargs.get('linewidth', 2), |
110 |
| - color=plot_kwargs.get('color', 'blue')) |
| 112 | + linewidth=plot_kwargs.get('linewidth', 2), |
| 113 | + color=plot_kwargs.get('color', 'blue')) |
111 | 114 |
|
112 | 115 | else:
|
113 | 116 | # Plot median
|
114 | 117 | ax.plot(ntiles[1], y, marker=plot_kwargs.get('marker', 'o'),
|
115 |
| - color=plot_kwargs.get('color', 'blue'), |
116 |
| - markersize=plot_kwargs.get('markersize', 4)) |
| 118 | + color=plot_kwargs.get('color', 'blue'), |
| 119 | + markersize=plot_kwargs.get('markersize', 4)) |
117 | 120 |
|
118 | 121 | # Plot outer interval
|
119 | 122 | ax.errorbar(x=(ntiles[0], ntiles[-1]), y=(y, y),
|
|
0 commit comments