Permalink
Browse files

Merge pull request #1061 from bgamari/master

Add log option to Axes.hist2d
  • Loading branch information...
2 parents dd9cfa4 + d33877c commit f3ccff33e0f5e3b0c6c3d313da87616bca4e621e @WeatherGod WeatherGod committed Sep 4, 2012
Showing with 15 additions and 1 deletion.
  1. +10 −0 examples/pylab_examples/hist2d_log_demo.py
  2. +5 −1 lib/matplotlib/axes.py
@@ -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()
View
@@ -8223,7 +8223,11 @@ def hist2d(self, x, y, bins = 10, range=None, normed=False, weights=None,
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:**

0 comments on commit f3ccff3

Please sign in to comment.