def singlerose(self, Width=1, Color=['red']):
        '''
        draw the rose map of single sample with different items~
        '''
        self.chooser_label.setText(self.ChooseItems[self.chooser.value() - 1])

        self.MultipleRoseName = self.ChooseItems[self.chooser.value() - 1]

        self.SingleRoseName = [(self.ChooseItems[self.chooser.value() - 1])]

        Name = self.SingleRoseName

        self.axes.clear()
        # self.axes.set_xlim(-90, 450)
        # self.axes.set_ylim(0, 90)

        titles = list('NWSE')

        titles = ['N', '330', '300', 'W', '240', '210', 'S', '150', '120', 'E', '60', '30']
        self.n = len(titles)
        self.angles = np.arange(90, 90 + 360, 360.0 / self.n)

        self.angles = np.array([90., 120., 150., 180., 210., 240., 270., 300., 330.,
                                360., 30., 60.])
        self.axes.set_thetagrids(self.angles, labels=titles, fontsize=14)

        self.raw = self._df

        real_max = []

        for k in range(len(Name)):

            Data = []
            S = []
            R = []
            for i in range(len(self.raw)):
                S.append(self.raw.at[i, Name[k]])

            s = np.linspace(0, 360, 360 / self.Gap + 1)
            t = tuple(s.tolist())
            count = []

            for i in range(len(t)):
                tmp_count = 0
                for j in S:
                    if i < len(t) - 1:
                        if t[i] < j <= t[i + 1]:
                            tmp_count += 1
                count.append(tmp_count)

            count_max = max(count)
            real_max.append(count_max)

        maxuse = max(real_max)

        for k in range(len(Name)):
            Data = []
            S = []
            R = []
            for i in range(len(self.raw)):
                S.append(self.raw.at[i, Name[k]])

            s = np.linspace(0, 360, 360 / self.Gap + 1)
            t = tuple(s.tolist())
            count = []

            for i in range(len(t)):
                tmp_count = 0
                for j in S:
                    if i < len(t) - 1:
                        if t[i] < j <= t[i + 1]:
                            tmp_count += 1
                count.append(tmp_count)
            s = np.linspace(0, 360, 360 / self.Gap + 1)
            t = tuple(s.tolist())

            R_factor = 90 / maxuse

            for i in count:
                TMP = 90 - i * R_factor
                R.append(TMP)

            m, n = self.Trans(t, R)
            self.axes.plot(m, n, color=Color[k], linewidth=1, alpha=0.6, marker='')
            self.axes.fill(m, n, Color=Color[k], Alpha=0.6, )

        if (self.Type_cb.isChecked()):
            self.Type_cb.setText('Wulf')
            list1 = [self.eqan(x) for x in range(15, 90, 15)]
        else:
            self.Type_cb.setText('Schmidt')
            list1 = [self.eqar(x) for x in range(15, 90, 15)]


        list2= list1


        print(maxuse + 1)

        try:
            list2 = [str(x) for x in range(0, int(maxuse + 1), int((maxuse + 1.0) / 7.0))]
        except(ValueError):
            pass
        list2.reverse()
        self.axes.set_rgrids(list1, list2)

        #self.axes.set_thetagrids(range(360 + 90, 0 + 90, -15), [str(x) for x in range(0, 360, 15)])



        if (self.legend_cb.isChecked()):
            self.axes.legend(bbox_to_anchor=(1.5, 1), loc=2, borderaxespad=0, prop=fontprop)
def singlerose ( self , Width = 1 , Color = [ 'red' ] ) : self . chooser_label . setText ( self . ChooseItems [ self . chooser . value ( ) - 1 ] ) self . MultipleRoseName = self . ChooseItems [ self . chooser . value ( ) - 1 ] self . SingleRoseName = [ ( self . ChooseItems [ self . chooser . value ( ) - 1 ] ) ] Name = self . SingleRoseName self . axes . clear ( ) titles = list ( 'NWSE' ) titles = [ 'N' , '330' , '300' , 'W' , '240' , '210' , 'S' , '150' , '120' , 'E' , '60' , '30' ] self . n = len ( titles ) self . angles = np . arange ( 90 , 90 + 360 , 360.0 / self . n ) self . angles = np . array ( [ 90. , 120. , 150. , 180. , 210. , 240. , 270. , 300. , 330. , 360. , 30. , 60. ] ) self . axes . set_thetagrids ( self . angles , labels = titles , fontsize = 14 ) self . raw = self . _df real_max = [ ] for k in range ( len ( Name ) ) : Data = [ ] S = [ ] R = [ ] for i in range ( len ( self . raw ) ) : S . append ( self . raw . at [ i , Name [ k ] ] ) s = np . linspace ( 0 , 360 , 360 / self . Gap + 1 ) t = tuple ( s . tolist ( ) ) count = [ ] for i in range ( len ( t ) ) : tmp_count = 0 for j in S : if i < len ( t ) - 1 : if t [ i ] < j <= t [ i + 1 ] : tmp_count += 1 count . append ( tmp_count ) count_max = max ( count ) real_max . append ( count_max ) maxuse = max ( real_max ) for k in range ( len ( Name ) ) : Data = [ ] S = [ ] R = [ ] for i in range ( len ( self . raw ) ) : S . append ( self . raw . at [ i , Name [ k ] ] ) s = np . linspace ( 0 , 360 , 360 / self . Gap + 1 ) t = tuple ( s . tolist ( ) ) count = [ ] for i in range ( len ( t ) ) : tmp_count = 0 for j in S : if i < len ( t ) - 1 : if t [ i ] < j <= t [ i + 1 ] : tmp_count += 1 count . append ( tmp_count ) s = np . linspace ( 0 , 360 , 360 / self . Gap + 1 ) t = tuple ( s . tolist ( ) ) R_factor = 90 / maxuse for i in count : TMP = 90 - i * R_factor R . append ( TMP ) m , n = self . Trans ( t , R ) self . axes . plot ( m , n , color = Color [ k ] , linewidth = 1 , alpha = 0.6 , marker = '' ) self . axes . fill ( m , n , Color = Color [ k ] , Alpha = 0.6 , ) if ( self . Type_cb . isChecked ( ) ) : self . Type_cb . setText ( 'Wulf' ) list1 = [ self . eqan ( x ) for x in range ( 15 , 90 , 15 ) ] else : self . Type_cb . setText ( 'Schmidt' ) list1 = [ self . eqar ( x ) for x in range ( 15 , 90 , 15 ) ] list2 = list1 print ( maxuse + 1 ) try : list2 = [ str ( x ) for x in range ( 0 , int ( maxuse + 1 ) , int ( ( maxuse + 1.0 ) / 7.0 ) ) ] except ( ValueError ) : pass list2 . reverse ( ) self . axes . set_rgrids ( list1 , list2 ) if ( self . legend_cb . isChecked ( ) ) : self . axes . legend ( bbox_to_anchor = ( 1.5 , 1 ) , loc = 2 , borderaxespad = 0 , prop = fontprop )
draw the rose map of single sample with different items~