8000 EllipseCollection renders incorrectly when passed a sequence of widths · Issue #5545 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
EllipseCollection renders incorrectly when passed a sequence of widths #5545
Closed
@astromancer

Description

@astromancer

The code below illustrates the issue:

import matplotlib.pyplot as plt
from matplotlib.collections import EllipseCollection

fig, ax = plt.subplots( )

widths, heights, angles = 10, 10, 0
coords = [(10,10),(15,15)]
e = EllipseCollection( widths, heights, angles,
                        units='xy', 
                        offsets=coords, 
                        transOffset=ax.transData )

ax.add_collection( e )

ax.set_xlim( 0, 30 )
ax.set_ylim( 0, 30 )`

Produces
ellipses1
as expected.

However, changing widths=10,10 produces the following.
ellipses2
Here the sizes are not transformed to the 'xy' units as expected.

The same thing happens when changing any of the other cyclable properties. eg: facecolor = 'rg'

The second case: widths=10,10 works as expected in 1.4.3, producing the first figure. I've tried to locate the issue in source, but I'm not familiar enough with the code to pinpoint exactly what is going wrong.

PS: I'm using the EllipseCollection as a base class to create a interactive tool for reducing astronomical image data here: https://github.com/apodemus/obstools/blob/master/ApertureCollections.py

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0