In [1]:
%matplotlib inline
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import numpy as np
In [ ]:
a = np.load('color_quantization/quantized_counts.npy')
b = np.load('color_quantization/pts_in_hull.npy')
print (a)
[ 1595074 621220 263024 161915 98955 11242009 6623303 3473057
1595074 621220 263024 161915 98955 25910929 17516175 11245070
6626364 3476118 1598135 624281 266085 164976 102016 2301231
6338870 25938225 17543471 11272366 6653660 3503414 1625431 651577
293381 192272 129312 1044916 2352441 6390080 25989435 17594681
11323576 6704870 3554624 1676641 702787 344591 243482 180522
81567 853685 1356177 2663702 6701341 26300696 17905942 11634837
7016131 3865885 1987902 1014048 655852 554743 491783 392828
1377697 1651484 2153976 3461501 7499140 27098495 18703741 12432636
7813930 4663684 2785701 1811847 1453651 1352542 1289582 1190627
3400660 3674447 4176939 5484464 9522103 29121458 20726704 14455599
9836893 6686647 4808664 3834810 3476614 3375505 3312545 3213590
8809183 8946188 9219975 9722467 11029992 15067631 34666986 26272232
20001127 15382421 12232175 10354192 9380338 9022142 8921033 8858073
8759118 44058899 44071791 44208796 44482583 44985075 46292600 50330239
69929594 61534840 55263735 50645029 47494783 45616800 44642946 44284750
44183641 44120681 44021726 12789051 12812575 12825467 12962472 13236259
13738751 15046276 19083915 38683270 30288516 24017411 19398705 16248459
14370476 13396622 13038426 12937317 12874357 4203679 4227203 4240095
4377100 4650887 5153379 6460904 10498543 30097898 21703144 15432039
10813333 7663087 5785104 4811250 4453054 4351945 4288985 1493423
1506929 1530453 1543345 1680350 1954137 2456629 3764154 7801793
27401148 19006394 12735289 8116583 4966337 3088354 2114500 1756304
1655195 1592235 748888 749031 762537 786061 798953 935958
1209745 1712237 3019762 7057401 26656756 18262002 11990897 7372191
4221945 2343962 1370108 1011912 910803 847843 447802 447945
461451 484975 497867 634872 908659 1411151 2718676 6756315
26355670 17960916 11689811 7071105 3920859 2042876 1069022 710826
609717 286426 286426 286569 300075 323599 336491 473496
747283 1249775 2557300 6594939 26194294 17799540 11528435 6909729
3759483 1881500 907646 549450 448341 137623 137623 137766
151272 174796 187688 324693 598480 1100972 2408497 6446136
26045491 17650737 11379632 6760926 3610680 1732697 758843 400647
299538 18743 18743 18886 32392 55916 68808 205813
479600 982092 2289617 6327256 25926611 17531857 11260752 6642046
3491800 1613817 639963 281767 164 164 307 13813
37337 50229 187234 461021 963513 2271038 6308677 25908032
17513278 11242173 6623467 3473221 1595238 621384 263188 143
13649 37173 50065 187070 460857 963349 2270874 6308513
25907868]
In [ ]:
a = np.reshape(a, [1, 313])
print (a.shape)
print(a)
plt.hist(a, 313)
plt.show()
print a
(1, 313)
[[ 1595074 621220 263024 161915 98955 11242009 6623303 3473057
1595074 621220 263024 161915 98955 25910929 17516175 11245070
6626364 3476118 1598135 624281 266085 164976 102016 2301231
6338870 25938225 17543471 11272366 6653660 3503414 1625431 651577
293381 192272 129312 1044916 2352441 6390080 25989435 17594681
11323576 6704870 3554624 1676641 702787 344591 243482 180522
81567 853685 1356177 2663702 6701341 26300696 17905942 11634837
7016131 3865885 1987902 1014048 655852 554743 491783 392828
1377697 1651484 2153976 3461501 7499140 27098495 18703741 12432636
7813930 4663684 2785701 1811847 1453651 1352542 1289582 1190627
3400660 3674447 4176939 5484464 9522103 29121458 20726704 14455599
9836893 6686647 4808664 3834810 3476614 3375505 3312545 3213590
8809183 8946188 9219975 9722467 11029992 15067631 34666986 26272232
20001127 15382421 12232175 10354192 9380338 9022142 8921033 8858073
8759118 44058899 44071791 44208796 44482583 44985075 46292600 50330239
69929594 61534840 55263735 50645029 47494783 45616800 44642946 44284750
44183641 44120681 44021726 12789051 12812575 12825467 12962472 13236259
13738751 15046276 19083915 38683270 30288516 24017411 19398705 16248459
14370476 13396622 13038426 12937317 12874357 4203679 4227203 4240095
4377100 4650887 5153379 6460904 10498543 30097898 21703144 15432039
10813333 7663087 5785104 4811250 4453054 4351945 4288985 1493423
1506929 1530453 1543345 1680350 1954137 2456629 3764154 7801793
27401148 19006394 12735289 8116583 4966337 3088354 2114500 1756304
1655195 1592235 748888 749031 762537 786061 798953 935958
1209745 1712237 3019762 7057401 26656756 18262002 11990897 7372191
4221945 2343962 1370108 1011912 910803 847843 447802 447945
461451 484975 497867 634872 908659 1411151 2718676 6756315
26355670 17960916 11689811 7071105 3920859 2042876 1069022 710826
609717 286426 286426 286569 300075 323599 336491 473496
747283 1249775 2557300 6594939 26194294 17799540 11528435 6909729
3759483 1881500 907646 549450 448341 137623 137623 137766
151272 174796 187688 324693 598480 1100972 2408497 6446136
26045491 17650737 11379632 6760926 3610680 1732697 758843 400647
299538 18743 18743 18886 32392 55916 68808 205813
479600 982092 2289617 6327256 25926611 17531857 11260752 6642046
3491800 1613817 639963 281767 164 164 307 13813
37337 50229 187234 461021 963513 2271038 6308677 25908032
17513278 11242173 6623467 3473221 1595238 621384 263188 143
13649 37173 50065 187070 460857 963349 2270874 6308513
25907868]]
/usr/lib/pymodules/python2.7/matplotlib/axes.py:8261: UserWarning: 2D hist input should be nsamples x nvariables;
this looks transposed (shape is 1 x 313)
'this looks transposed (shape is %d x %d)' % x.shape[::-1])
---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-3-7cb809434340> in <module>()
2 print (a.shape)
3 print(a)
----> 4 plt.hist(a, 313)
5 plt.show()
6 print a
/usr/lib/pymodules/python2.7/matplotlib/pyplot.pyc in hist(x, bins, range, normed, weights, cumulative, bottom, histtype, align, orientation, rwidth, log, color, label, stacked, hold, **kwargs)
2825 histtype=histtype, align=align, orientation=orientation,
2826 rwidth=rwidth, log=log, color=color, label=label,
-> 2827 stacked=stacked, **kwargs)
2828 draw_if_interactive()
2829 finally:
/usr/lib/pymodules/python2.7/matplotlib/axes.pyc in hist(self, x, bins, range, normed, weights, cumulative, bottom, histtype, align, orientation, rwidth, log, color, label, stacked, **kwargs)
8404 patch = _barfunc(bins[:-1]+boffset, height, width,
8405 align='center', log=log,
-> 8406 color=c, **{bottom_kwarg: bottom})
8407 patches.append(patch)
8408 if stacked:
/usr/lib/pymodules/python2.7/matplotlib/axes.pyc in bar(self, left, height, width, bottom, **kwargs)
5046 edgecolor=e,
5047 linewidth=lw,
-> 5048 label='_nolegend_'
5049 )
5050 r.update(kwargs)
/usr/lib/pymodules/python2.7/matplotlib/patches.pyc in __init__(self, xy, width, height, angle, **kwargs)
541 """
542
--> 543 Patch.__init__(self, **kwargs)
544
545 self._x = xy[0]
/usr/lib/pymodules/python2.7/matplotlib/patches.pyc in __init__(self, edgecolor, facecolor, color, linewidth, linestyle, antialiased, hatch, fill, **kwargs)
78 linestyle = "solid"
79 if antialiased is None:
---> 80 antialiased = mpl.rcParams['patch.antialiased']
81
82 self._fill = True # needed for set_facecolor call
KeyboardInterrupt:
In [ ]:
Content source: MIT-6819-team/TF_colorization
Similar notebooks: