Skip to content

Commit e574134

Browse files
author
Christopher Fonnesbeck
committed
Added flag in traceplot for turning off distracting gridlines in histogram
1 parent 497ddac commit e574134

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pymc/plots.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
__all__ = ['traceplot', 'kdeplot', 'kde2plot', 'forestplot', 'autocorrplot']
1313

14-
def traceplot(trace, vars=None, figsize=None, lines=None, combined=False):
14+
def traceplot(trace, vars=None, figsize=None, lines=None, combined=False, grid=True):
1515
"""Plot samples histograms and values
1616
1717
Parameters
@@ -29,6 +29,8 @@ def traceplot(trace, vars=None, figsize=None, lines=None, combined=False):
2929
combined : bool
3030
Flag for combining MultiTrace into a single trace. If False (default)
3131
traces will be plotted separately on the same set of axes.
32+
grid : bool
33+
Flag for adding gridlines to histogram. Defaults to True.
3234
3335
Returns
3436
-------
@@ -64,7 +66,7 @@ def traceplot(trace, vars=None, figsize=None, lines=None, combined=False):
6466
else:
6567
kdeplot_op(ax[i, 0], d)
6668
ax[i, 0].set_title(str(v))
67-
ax[i, 0].grid(True)
69+
ax[i, 0].grid(grid)
6870
ax[i, 1].set_title(str(v))
6971
ax[i, 1].plot(d, alpha=.35)
7072

0 commit comments

Comments
 (0)