#-*-Coding:utf-8-*-"" "Created on Wed June-13:00:11 2017@author:miao" "" Import NumPy as NP import Scipyimport Matplot Lib as mplmpl.use (' agg ') import Matplotlib.pyplot as Pltfrom matplotlib.backends.backend_pdf import Pdfpagesfrom Matplotlib Import Rcfont = {' weight ': ' normal '} fig = plt.figure (1, figsize= (8)) pp = pdfpages (' test_100.pdf ') t=[' (a) ', ' (b) ', ' (c) ', ' (d) ', ' (e) ', ' (f) '];d ata_name = [' ORL ', ' lung ', ' JAFFE ', ' COIL20 ', ' tox_171 ', ' warpar10p ']; K = [' 5 ', ' + ', ' + ']i = 1for j in range (Len (data_name)): data = Data_name[j] #for data in data_name:data1 = Data+ ' _1 + ' + '. Mat ' mat1 = Scipy.io.loadmat (data1) xx = mat1[' Acc '] xx = xx*100 ax = fig.add_subplot (2,3,i) bp = ax . BoxPlot (XX. T, Patch_artist=true) if data is ' tox_171 ': data = ' tox\_171 ' Plt.title (t[j]+ "+data,fontsize=16) for box in bp[' boxes ": Box.set (color= ' #7570b3 ', linewidth=1) box.set (facecolor = ' #1b9e77 ') for whisker In bp[' Whiskers ': Whisker.set (color= ')#7570b3 ', linewidth=1) for cap in bp[' caps ': Cap.set (color= ' #7570b3 ', linewidth=2) for median in bp[' medians ']: Median.set (color= ' #b2df8a ', linewidth=1) for flier in bp[' fliers ']: Flier.set (marker= ' o ', color= ' #e72 98a ', alpha=0.5) # ax.set_xticklabels ([' F\_score ', ' trace\_ratio ', ' Relieff ', ' fisher\_score ', ' RFS ', R ' $\ell_{2,1-2}$ '],fontdict=font ' i=i+1# plt.xlabel (' Data sets ', fontsize=14) Plt.ylabel (' Accuracy (\%) ', fontsize=16) # PLT. Ylim (Ytc[j]) plt.xticks (fontsize=16) plt.yticks (fontsize=16) plt.savefig (pp,format= ' PDF ') Pp.savefig () Pp.close ()
Python picture box line diagram