Skip to content

Commit

Permalink
Merge pull request #125 from rprechelt/master
Browse files Browse the repository at this point in the history
Add pcolor_kwargs and changed default kwargs args checks
  • Loading branch information
dfm committed Oct 28, 2019
2 parents 790e427 + e8873fb commit 6d8fc76
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions corner/corner.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@ def hist2d(x, y, bins=20, range=None, weights=None, levels=None, smooth=None,
plot_datapoints=True, plot_density=True,
plot_contours=True, no_fill_contours=False, fill_contours=False,
contour_kwargs=None, contourf_kwargs=None, data_kwargs=None,
**kwargs):
pcolor_kwargs=None, **kwargs):

"""
Plot a 2-D histogram of samples.
Expand Down Expand Up @@ -532,6 +533,10 @@ def hist2d(x, y, bins=20, range=None, weights=None, levels=None, smooth=None,
Any additional keyword arguments to pass to the `plot` method when
adding the individual data points.
pcolor_kwargs : dict
Any additional keyword arguments to pass to the `pcolor` method when
adding the density colormap.
"""
if ax is None:
ax = pl.gca()
Expand Down Expand Up @@ -657,7 +662,9 @@ def hist2d(x, y, bins=20, range=None, weights=None, levels=None, smooth=None,
# Plot the density map. This can't be plotted at the same time as the
# contour fills.
elif plot_density:
ax.pcolor(X, Y, H.max() - H.T, cmap=density_cmap)
if pcolor_kwargs is None:
pcolor_kwargs = dict()
ax.pcolor(X, Y, H.max() - H.T, cmap=density_cmap, **pcolor_kwargs)

# Plot the contour edge colors.
if plot_contours:
Expand Down

0 comments on commit 6d8fc76

Please sign in to comment.