Python picture box line diagram

Source: Internet
Author: User

#-*-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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.