I want to plot a 2D array (roughly 1000x1000) with the values corresponding to a color scale. So I used matplotlib.pcolor, which did just that but for some reason it is super slow when it gets to those dimensions (like 2 minutes or so just to plot). What is the reason for that? Would converting the float values to int16 or so help? Are there any alternatives to pcolor?
from pylab import *
data=genfromtxt('data.txt',autostrip=True, case_sensitive=True)
pcolor(data,cmap='hot')
colorbar()
show()
data.txt is containing the array. The loading process does take a few seconds, but the main computing time is definitely used by BOTH the pcolor() and show() function (roughly maybe 60-90 secs each).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…