Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions pymc3/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,7 @@ def make_2d(a):
return a


def kde2plot_op(ax, x, y, grid=200, cmap=None):

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()
Expand All @@ -167,8 +164,7 @@ def kde2plot_op(ax, x, y, grid=200, cmap=None):
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])
ax.imshow(np.rot90(Z), extent=[xmin, xmax, ymin, ymax], **kwargs)


def kdeplot(data, ax=None):
Expand All @@ -178,10 +174,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, **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, **kwargs)
return ax


Expand Down