From 4ce9e2c364ba37aff8a8f64ebecb73c936bc2c70 Mon Sep 17 00:00:00 2001 From: Eigenblutwurst Date: Mon, 7 Nov 2016 13:19:52 +0300 Subject: [PATCH 1/2] kde plot added kwargs --- pymc3/plots.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pymc3/plots.py b/pymc3/plots.py index a2f18a7469..ee53479935 100644 --- a/pymc3/plots.py +++ b/pymc3/plots.py @@ -150,7 +150,7 @@ def make_2d(a): return a -def kde2plot_op(ax, x, y, grid=200, cmap=None): +def kde2plot_op(ax, x, y, grid=200, cmap=None, **kwargs): if cmap is None: cmap =plt.cm.gist_earth_r @@ -168,7 +168,7 @@ def kde2plot_op(ax, x, y, grid=200, cmap=None): Z = np.reshape(kernel(positions).T, X.shape) ax.imshow(np.rot90(Z), cmap=cmap, - extent=[xmin, xmax, ymin, ymax]) + extent=[xmin, xmax, ymin, ymax], **kwargs) def kdeplot(data, ax=None): @@ -178,10 +178,10 @@ def kdeplot(data, ax=None): return ax -def kde2plot(x, y, grid=200, ax=None, cmap=None): +def kde2plot(x, y, grid=200, ax=None, cmap=None, **kwargs): if ax is None: f, ax = plt.subplots(1, 1, squeeze=True) - kde2plot_op(ax, x, y, grid, cmap) + kde2plot_op(ax, x, y, grid, cmap, **kwargs) return ax From e494d1c34e8f6f06ab3f51c899d9524be3308449 Mon Sep 17 00:00:00 2001 From: Eigenblutwurst Date: Mon, 7 Nov 2016 16:35:21 +0300 Subject: [PATCH 2/2] move cmap to kwargs --- pymc3/plots.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pymc3/plots.py b/pymc3/plots.py index ee53479935..10da9b5ff4 100644 --- a/pymc3/plots.py +++ b/pymc3/plots.py @@ -150,10 +150,7 @@ def make_2d(a): return a -def kde2plot_op(ax, x, y, grid=200, cmap=None, **kwargs): - - if cmap is None: - cmap =plt.cm.gist_earth_r +def kde2plot_op(ax, x, y, grid=200, **kwargs): xmin = x.min() xmax = x.max() @@ -167,8 +164,7 @@ def kde2plot_op(ax, x, y, grid=200, cmap=None, **kwargs): kernel = kde.gaussian_kde(values) Z = np.reshape(kernel(positions).T, X.shape) - ax.imshow(np.rot90(Z), cmap=cmap, - extent=[xmin, xmax, ymin, ymax], **kwargs) + ax.imshow(np.rot90(Z), extent=[xmin, xmax, ymin, ymax], **kwargs) def kdeplot(data, ax=None): @@ -178,10 +174,10 @@ def kdeplot(data, ax=None): return ax -def kde2plot(x, y, grid=200, ax=None, cmap=None, **kwargs): +def kde2plot(x, y, grid=200, ax=None, **kwargs): if ax is None: f, ax = plt.subplots(1, 1, squeeze=True) - kde2plot_op(ax, x, y, grid, cmap, **kwargs) + kde2plot_op(ax, x, y, grid, **kwargs) return ax