remove/reset matplotlib quiver arrows
I am using quiver with varying head/line size to represent the time evolution(x axis) of a property(y axis) and the mass(arrow size) of galaxies. And I want to draw the arrows for thousands of galaxies on a common underlying density map. I want to avoid redrawing the common density map over and over, and only want to modify U,V and sizes of the arrows. From this answer, I learned that I can reset quiver plot values instead of redrawing them to speed up the code. But I couldn't find a way to reset the size of arrow head. If I need to use something else such as arrow annotation to achieve this, that is fine. fig, ax = plt.subplots() ## xx, yy are ~100000 points. So I want to reuse the scatter plot. im = ax.scatter(xx, yy, c=z, s=50, edgecolor='', cmap=cmap) # there are thousands of galaxies. for gal in galaxies: nn, mm, ll = simple_evol_path(gal) widths = np.sqrt(mm[:-1]/1e9) # I had to use a loop to change head size each time. for i in range(len(mm)-1): mm = im.axes.quiver(nn[i], ll[i], nn[i+1]-nn[i], ll[i+1]-ll[i], scale_units='xy', angles='xy', scale=1, linewidth = 0.005 * widths[i]**3, headwidth = 2 * widths[i]**0.5, headlength = 0.7 * widths[i], headaxislength = 0.55 * widths[i]) plt.savefig(str(i) + ".png") # Remove quiver or reset nn, ll, and all the arrow properties here? How can I efficiently do the job?
Get the key with the maximum nested key in a python dictionary
Python fermat program only works for low numbers
How to create list of all parts of elements in NumPy array (Python list)
Encoding issue for Python tool Unidecode on CL
Accept only numbers on a python string [closed]
scrapy spider pass parameters
sending data to particular client from twisted server
Type Error, object cannot be interpreted as an index with tk message box bind commands
What is this condition testing? [duplicate]
Testing Flask login and authentication?
Pyjnius import jar file
Regex - Combining an 'or' with a 'look-behind'
Command fails in python, but not in terminal
Does ndb.toplevel break transactions?
Unique variables names for results in a nested loop
Get unique set of adjacent vertices in python bulbs or gremlin?