python


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?

Related Links

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?

Categories

HOME
xbox-live
makefile
jdbc
cntk
numpy
ssas-2012
amazon-swf
drupal-7
ocaml
fparsec
command
hana
safari
ext.net
avl-tree
eval
structuremap
wysiwyg
flann
scaling
alfresco-share
android-toolbar
flexlm
jive
memsql
bootstrap-typeahead
pdfsharp
visual-c++-2017
onesignal
pptp
mangodb
expand
canvasjs
ios-ui-automation
openpgp
remote-server
vmd
agent
wcf-security
cppunit
lumen-5.3
drawingarea
ti-basic
struts-layout
windows-95
mbaas
android-bitmap
rpostgresql
butterknife
execl
infinite-scroll
python-hypothesis
date-range
laravel-query-builder
onresume
sqldatareader
objloader
iostat
packagemaker
icefaces
galleriffic
visible
angularjs-ng-pattern
freetype2
achievements
gmsmapview
django-south
altbeacon
acm
difference
schtasks.exe
application-loader
vips
mptcp
sysfs
sqoop2
tilestache
cpu-speed
ibmsbt
cg
firebug-lite
sthttprequest
coin-flipping
dbsetup
layered
dllexport
backbone-relational
shortcuts
sharpmap
process-monitor
osi
web-safe-fonts
radchart
cadisplaylink
tfs-power-tools
subtract
unions
text-services-framework
handwriting
ets
msn
asp.net-routing
sitemappath
task-management
act
visual-studio-2010-beta-2
odbc-sql-server-driver
virtualquery
associativity

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App