def multirose(self, Width=1, Name='Dip'):
        '''
        draw the rose map of multiple samples~
        '''

        Name = self.MultipleRoseName

        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 = []

        S = []
        R = []
        Color = []
        Label = []
        Whole = {}

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

            if self.raw.at[i, 'Color'] not in Color and self.raw.at[i, 'Color'] != '':
                Color.append(self.raw.at[i, 'Color'])
            if self.raw.at[i, 'Label'] not in Label and self.raw.at[i, 'Label'] != '':
                Label.append(self.raw.at[i, 'Label'])

        Whole = ({k: [] for k in Label})

        WholeCount = ({k: [] for k in Label})

        for i in range(len(self.raw)):
            for k in Label:
                if self.raw.at[i, 'Label'] == k:
                    Whole[k].append(self.raw.at[i, Name])

        t = tuple(np.linspace(0, 360, 360 / self.Gap + 1).tolist())
        real_max = 0

        for j in range(len(Label)):

            for i in range(len(t)):
                tmp_count = 0
                for u in Whole[Label[j]]:
                    if i < len(t) - 1:
                        if t[i] < u <= t[i + 1]:
                            tmp_count += 1
                real_max = max(real_max, tmp_count)
                WholeCount[Label[j]].append(tmp_count)

        maxuse = real_max
        R_factor = 90 / maxuse

        for j in range(len(Label)):

            R = []
            for i in WholeCount[Label[j]]:
                TMP = 90 - i * R_factor
                R.append(TMP)

            m, n = self.Trans(t, R)
            self.axes.plot(m, n, color=Color[j], linewidth=1, alpha=0.6, marker='', label=Label[j])
            self.axes.fill(m, n, Color=Color[j], 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

        try:
            list2 = [str(x) for x in range(0, int(maxuse + 1), int((maxuse + 1) / 7))]
        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 multirose ( self , Width = 1 , Name = 'Dip' ) : Name = self . MultipleRoseName 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 = [ ] S = [ ] R = [ ] Color = [ ] Label = [ ] Whole = { } for i in range ( len ( self . raw ) ) : S . append ( self . raw . at [ i , Name ] ) if self . raw . at [ i , 'Color' ] not in Color and self . raw . at [ i , 'Color' ] != '' : Color . append ( self . raw . at [ i , 'Color' ] ) if self . raw . at [ i , 'Label' ] not in Label and self . raw . at [ i , 'Label' ] != '' : Label . append ( self . raw . at [ i , 'Label' ] ) Whole = ( { k : [ ] for k in Label } ) WholeCount = ( { k : [ ] for k in Label } ) for i in range ( len ( self . raw ) ) : for k in Label : if self . raw . at [ i , 'Label' ] == k : Whole [ k ] . append ( self . raw . at [ i , Name ] ) t = tuple ( np . linspace ( 0 , 360 , 360 / self . Gap + 1 ) . tolist ( ) ) real_max = 0 for j in range ( len ( Label ) ) : for i in range ( len ( t ) ) : tmp_count = 0 for u in Whole [ Label [ j ] ] : if i < len ( t ) - 1 : if t [ i ] < u <= t [ i + 1 ] : tmp_count += 1 real_max = max ( real_max , tmp_count ) WholeCount [ Label [ j ] ] . append ( tmp_count ) maxuse = real_max R_factor = 90 / maxuse for j in range ( len ( Label ) ) : R = [ ] for i in WholeCount [ Label [ j ] ] : TMP = 90 - i * R_factor R . append ( TMP ) m , n = self . Trans ( t , R ) self . axes . plot ( m , n , color = Color [ j ] , linewidth = 1 , alpha = 0.6 , marker = '' , label = Label [ j ] ) self . axes . fill ( m , n , Color = Color [ j ] , 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 try : list2 = [ str ( x ) for x in range ( 0 , int ( maxuse + 1 ) , int ( ( maxuse + 1 ) / 7 ) ) ] 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 multiple samples~