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

Commit781e7f7

Browse files
committed
Add whats_new entry
1 parentc92f106 commit781e7f7

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Add ``RectangleCollection``
2+
---------------------------
3+
4+
The `~matplotlib.collections.RectangleCollection` is added to create collection of `~matplotlib.patches.Rectangle`
5+
6+
..plot::
7+
:include-source: true
8+
9+
import matplotlib.pyplot as plt
10+
from matplotlib.collections import RectangleCollection
11+
import numpy as np
12+
13+
rng = np.random.default_rng(0)
14+
15+
widths = (2, )
16+
heights = (3, )
17+
angles = (45, )
18+
offsets = rng.random((10, 2)) * 10
19+
20+
fig, ax = plt.subplots()
21+
22+
ec = RectangleCollection(
23+
widths=widths,
24+
heights=heights,
25+
angles=angles,
26+
offsets=offsets,
27+
units='x',
28+
offset_transform=ax.transData,
29+
)
30+
31+
ax.add_collection(ec)
32+
ax.set_xlim(-2, 12)
33+
ax.set_ylim(-2, 12)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp