projects
/
django_unres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4edf019
)
np.histogram(bins='auto') not working in old numpy
author
Cezary Czaplewski
<czarek@chem.univ.gda.pl>
Sat, 30 Sep 2017 22:18:55 +0000
(
00:18
+0200)
committer
Cezary Czaplewski
<czarek@chem.univ.gda.pl>
Sat, 30 Sep 2017 22:18:55 +0000
(
00:18
+0200)
files/matplotlib_hist.py
patch
|
blob
|
history
diff --git
a/files/matplotlib_hist.py
b/files/matplotlib_hist.py
index
c37a5f6
..
f8a1105
100755
(executable)
--- a/
files/matplotlib_hist.py
+++ b/
files/matplotlib_hist.py
@@
-19,7
+19,7
@@
else:
x,y,s,r= np.loadtxt('remd_all.stat',usecols=(7,3,0,9),unpack=True)
x0,s0,r0= np.loadtxt('remd_all0.stat',usecols=(7,0,9),unpack=True)
x,y,s,r= np.loadtxt('remd_all.stat',usecols=(7,3,0,9),unpack=True)
x0,s0,r0= np.loadtxt('remd_all0.stat',usecols=(7,0,9),unpack=True)
-hall,binall=np.histogram(y,bins='auto',density=False)
+hall,binall=np.histogram(y,bins=40,density=False)
plt.xlim(min(binall), max(binall[hall>4]))
#plt.ylim(0,max(hall)/4)
plt.xlim(min(binall), max(binall[hall>4]))
#plt.ylim(0,max(hall)/4)
@@
-34,7
+34,7
@@
Tremd=map(float,sys.argv[1].split())
colors = cm.rainbow(np.linspace(0, 1, len(Tremd)))
for T,c in zip(Tremd,colors):
yt=y[x==T]
colors = cm.rainbow(np.linspace(0, 1, len(Tremd)))
for T,c in zip(Tremd,colors):
yt=y[x==T]
- h,bin=np.histogram(yt,bins='auto',density=False)
+ h,bin=np.histogram(yt,bins=40,range=(min(binall),max(binall[hall>4])),density=False)
center = (bin[:-1] + bin[1:]) / 2
plt.plot(center,h,'-',color=c)
# plt.bar(bin[:-1], h, width = bin[2]-bin[1],color=c)
center = (bin[:-1] + bin[1:]) / 2
plt.plot(center,h,'-',color=c)
# plt.bar(bin[:-1], h, width = bin[2]-bin[1],color=c)