Skip to content

Conversation

tacaswell
Copy link
Member

This was prompted by http://stackoverflow.com/questions/32444037/how-can-i-create-many-thousands-of-circles#32446502

I suspect that this is not the right way to achieve this (as it is mostly broken under log transform and the notion of 'area' under blended transform is confused)

but, with this patch

import matplotlib.pyplot as plt
import matplotlib.collections as mc
import numpy as np

ax = plt.gca()
cc = mc.CircleCollection(sizes=.001 * np.pi*np.random.rand(10000)**2,
                         offsets=np.random.rand(10000, 2),
                         transOffset=ax.transData,
                         facecolors='rgb')
cc.set_size_transform(ax.transData)
ax.add_collection(cc)


ax.set_aspect('equal')

Does the 'right thing' and renders relatively snappily (0.1-0.2 s).

Add an attribute to CollectionWithSizes to allow the user to specify a
transform to use to scale the paths in the collection.
@tacaswell tacaswell added this to the proposed next point release milestone Sep 7, 2015
@tacaswell
Copy link
Member Author

This still needs docs + tests even if this is the right direction to go.

ping @mdboom

@tacaswell tacaswell modified the milestone: 2.1 (next point release) Aug 29, 2017
@jklymak
Copy link
Member

jklymak commented Jul 14, 2020

Closing for lack of progress... Happy to re-open if this approach should be followed up...

@jklymak jklymak closed this Jul 14, 2020
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.

2 participants