xgi
xgi copied to clipboard
Speed up `draw_xgi_nodes` and `draw_xgi_hyperedges`
If we remove the for-loop in the function that draws the hypergraph nodes with scatter
and instead pass iterables into the scatter function, it could be faster. Also, if we plot Collection objects instead of Patch objects, maybe it will be faster as well. (https://stackoverflow.com/questions/37573314/matplotlib-efficient-way-to-create-large-number-of-patch-objects)
This might also be relevant: https://stackoverflow.com/questions/43216111/anyway-to-draw-many-lines-fast-in-python-matploblib-is-preferred-if-possible
Node speed-up implemented in #211
Any ideas on how to optimize the edge function?
I have a vague memory that it was supposed to be similar to the node speed-up, and that it was just that nobody implemented it. @nwlandry @iaciac ?
I tried to make it faster but my recollection was that plotting a collection of patches gave you less control over the color and other properties of individual edges compared with plotting a patch at a time.