Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rotation parameter has no effect on RegularPolyCollection #3574

Merged
merged 2 commits into from Sep 30, 2014

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Sep 27, 2014

It looks like the rotation parameter in RegularPolyCollection was disconnected in the following commit: b8726d0

Below is an example that should display squares with different rotations, but doesn't on master or 1.4.0.

import matplotlib.pyplot as plt
from matplotlib.collections import RegularPolyCollection
import numpy as np


xx, yy = np.mgrid[:10, :10]
xy_points = np.transpose([xx.flatten(), yy.flatten()])
rotations = np.linspace(0, 2*np.pi, len(xy_points))

fig, ax = plt.subplots()
for xy, alpha in zip(xy_points, rotations):
    col = RegularPolyCollection(4, sizes=(100,), rotation=alpha,
                                offsets=xy, transOffset=ax.transData)
    ax.add_collection(col, autolim=True)
ax.autoscale_view()

plt.show()

@mdboom
Copy link
Member

mdboom commented Sep 27, 2014

@tonysyu: This still needs a test, but could you confirm the attached resolves the issue for you?

@tonysyu
Copy link
Contributor Author

tonysyu commented Sep 27, 2014

@mdboom: 👍

@tacaswell
Copy link
Member

Could the test be modified so more of the marker is shown?

@mdboom
Copy link
Member

mdboom commented Sep 30, 2014

Oops -- forgot to do autoscale_view. Looks much better now.

tacaswell added a commit that referenced this pull request Sep 30, 2014
BUG : `rotation` parameter had no effect on `RegularPolyCollection`
@tacaswell tacaswell merged commit 638adf4 into matplotlib:v1.4.x Sep 30, 2014
@mdboom mdboom deleted the regular-polygon-rotation branch March 3, 2015 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants