Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions examples/pylab_examples/hist2d_log_demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from matplotlib.colors import LogNorm
from pylab import *

#normal distribution center at x=0 and y=5
x = randn(100000)
y = randn(100000)+5

hist2d(x, y, bins=40, norm=LogNorm())
colorbar()
show()
6 changes: 5 additions & 1 deletion lib/matplotlib/axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8077,7 +8077,11 @@ def hist2d(self, x, y, bins = 10, range=None, normed=False, weights=None,
All bins that has count more than cmax will not be displayed (set to none before passing to imshow)
and these count values in the return value count histogram will also be set to nan upon return

Remaining keyword arguments are passed directly to :meth:pcolorfast
Remaining keyword arguments are passed directly to :meth:`pcolorfast`.

Rendering the histogram with a logarithmic color scale is
accomplished by passing a :class:`colors.LogNorm` instance to
the *norm* keyword argument.

**Example:**

Expand Down