Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf3ccff3

Browse files
committed
Merge pull request#1061 from bgamari/master
Add log option to Axes.hist2d
2 parentsdd9cfa4 +d33877c commitf3ccff3

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
frommatplotlib.colorsimportLogNorm
2+
frompylabimport*
3+
4+
#normal distribution center at x=0 and y=5
5+
x=randn(100000)
6+
y=randn(100000)+5
7+
8+
hist2d(x,y,bins=40,norm=LogNorm())
9+
colorbar()
10+
show()

‎lib/matplotlib/axes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8223,7 +8223,11 @@ def hist2d(self, x, y, bins = 10, range=None, normed=False, weights=None,
82238223
these count values in the return value count histogram
82248224
will also be set to nan upon return
82258225
8226-
Remaining keyword arguments are passed directly to :meth:pcolorfast
8226+
Remaining keyword arguments are passed directly to :meth:`pcolorfast`.
8227+
8228+
Rendering the histogram with a logarithmic color scale is
8229+
accomplished by passing a :class:`colors.LogNorm` instance to
8230+
the *norm* keyword argument.
82278231
82288232
**Example:**
82298233

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp