We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 113e720 commit aa72167Copy full SHA for aa72167
pymc3/plots.py
@@ -150,7 +150,11 @@ def make_2d(a):
150
return a
151
152
153
-def kde2plot_op(ax, x, y, grid=200):
+def kde2plot_op(ax, x, y, grid=200, cmap=None):
154
+
155
+ if cmap is None:
156
+ cmap =plt.cm.gist_earth_r
157
158
xmin = x.min()
159
xmax = x.max()
160
ymin = y.min()
@@ -163,7 +167,7 @@ def kde2plot_op(ax, x, y, grid=200):
163
167
kernel = kde.gaussian_kde(values)
164
168
Z = np.reshape(kernel(positions).T, X.shape)
165
169
166
- ax.imshow(np.rot90(Z), cmap=plt.cm.gist_earth_r,
170
+ ax.imshow(np.rot90(Z), cmap=cmap,
171
extent=[xmin, xmax, ymin, ymax])
172
173
@@ -174,10 +178,10 @@ def kdeplot(data, ax=None):
174
178
return ax
175
179
176
180
177
-def kde2plot(x, y, grid=200, ax=None):
181
+def kde2plot(x, y, grid=200, ax=None, cmap=None):
182
if ax is None:
183
f, ax = plt.subplots(1, 1, squeeze=True)
- kde2plot_op(ax, x, y, grid)
184
+ kde2plot_op(ax, x, y, grid, cmap)
185
186
187
0 commit comments