Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a9ca79b

Browse files
committed
Fix #5545: Fix collection scale in data space
1 parent 8da435d commit a9ca79b

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

lib/matplotlib/tests/test_collections.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,27 @@ def test_linestyle_single_dashes():
597597
plt.draw()
598598

599599

600+
@image_comparison(baseline_images=['size_in_xy'], remove_text=True,
601+
extensions=['png'])
602+
def test_size_in_xy():
603+
fig, ax = plt.subplots()
604+
605+
widths, heights, angles = (10, 10), 10, 0
606+
widths = 10, 10
607+
coords = [(10, 10), (15, 15)]
608+
e = mcollections.EllipseCollection(
609+
widths, heights, angles,
610+
units='xy',
611+
offsets=coords,
612+
transOffset=ax.transData)
613+
614+
ax.add_collection(e)
615+
616+
ax.set_xlim(0, 30)
617+
ax.set_ylim(0, 30)
618+
619+
620+
600621
if __name__ == '__main__':
601622
import nose
602623
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

src/_backend_agg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,7 @@ inline void RendererAgg::_draw_path_collection_generic(GCAgg &gc,
986986
subtrans(1, 1),
987987
subtrans(0, 2),
988988
subtrans(1, 2));
989+
trans *= master_transform;
989990
} else {
990991
trans = master_transform;
991992
}

0 commit comments

Comments
 (0)