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

Appearance settings

Commit 673fb6a

Browse filesBrowse files
committed
Add whats_new entry
1 parent 5a9cd4e commit 673fb6a
Copy full SHA for 673fb6a

File tree

Expand file treeCollapse file tree

1 file changed

+40
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+40
-0
lines changed
+40Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Add ``widths``, ``heights`` and ``angles`` setter to ``EllipseCollection``
2+
--------------------------------------------------------------------------
3+
4+
The ``widths``, ``heights`` and ``angles`` values of the `~matplotlib.collections.EllipseCollection`
5+
can now be changed after the collection has been created.
6+
7+
.. plot::
8+
:include-source: true
9+
10+
import matplotlib.pyplot as plt
11+
from matplotlib.collections import EllipseCollection
12+
import numpy as np
13+
14+
rng = np.random.default_rng(0)
15+
16+
widths = (2, )
17+
heights = (3, )
18+
angles = (45, )
19+
offsets = rng.random((10, 2)) * 10
20+
21+
fig, ax = plt.subplots()
22+
23+
ec = EllipseCollection(
24+
widths=widths,
25+
heights=heights,
26+
angles=angles,
27+
offsets=offsets,
28+
units='x',
29+
offset_transform=ax.transData,
30+
)
31+
32+
ax.add_collection(ec)
33+
ax.set_xlim(-2, 12)
34+
ax.set_ylim(-2, 12)
35+
36+
new_widths = rng.random((10, 2)) * 2
37+
new_heights = rng.random((10, 2)) * 3
38+
new_angles = rng.random((10, 2)) * 180
39+
40+
ec.set(widths=new_widths, heights=new_heights, angles=new_angles)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.