util/plotfig.py
def _radar_plotting(self, data, xlabel = '', ylabel = '', grp_label = '', fill_color = True, fontsize = 12):
            """
            Show radar chart
        
            Parameters:
            ------------
            data: M*N series point, not recommend to read more than 3 groups in one radar chart. N means the number of group.
            xlabel: label in x-axis
            ylabel: label in y-axis
            grp_label: group label
            fill_color: whether fill radar with color (light blue)
            fontsize: fontsize
            """
            if isinstance(data, list) is True:
                data = np.array(data)
            if data.ndim == 1:
                data = np.expand_dims(data, axis=-1)
            pt_N = data.shape[0]
            grp_N = data.shape[1]
            if grp_label == '':
                grp_label = ['']*grp_N
            # Background
            angles = [n/float(pt_N)*2*np.pi for n in range(pt_N)]
            angles += angles[:1]

            ax = plt.subplot(111, polar=True)
            # Set theta direction and its offset
            ax.set_theta_offset(np.pi/2)
            ax.set_theta_direction(-1)
            # Draw xlabels
            plt.xticks(angles[:-1], xlabel, color = 'black', fontsize=fontsize)
            # Draw ylabels
            ax.set_rlabel_position(0)
            ax.set_ylabel(ylabel, color='black', fontsize=fontsize)
            if (np.min(data)<0) & (np.max(data)<0):
                ax.set_ylim([1.33*np.min(data), 0])
            elif (np.min(data)<0) & (np.max(data)>0):
                ax.set_ylim([1.33*np.min(data), 1.33*np.max(data)])
            else:
                ax.set_ylim([0, 1.33*np.max(data)])

            # Add plots
            for i in range(grp_N):
                tmp_data = data[:,i].tolist()
                tmp_data += tmp_data[:1]
                ax.plot(angles, tmp_data, linewidth=1, linestyle='solid', label=grp_label[i])
                if fill_color is True:
                    ax.fill(angles, tmp_data, 'b', alpha=0.1)

            # Add legend
            if grp_N > 1 & len(grp_label)>0:
                ax.legend(grp_label, loc=[0.9,0.9])
            
            if self._isshow is True: 
                plt.show()

            Show radar chart
        
            Parameters:
            ------------
            data: M*N series point, not recommend to read more than 3 groups in one radar chart. N means the number of group.
            xlabel: label in x-axis
            ylabel: label in y-axis
            grp_label: group label
            fill_color: whether fill radar with color (light blue)
            fontsize: fontsize
            
Show radar chart
Parameters.

M*N series point, not recommend to read more than 3 groups in one radar chart. N means the number of group.
Show radar chart Parameters . M * N series point not recommend to read more than 3 groups in one radar chart . N means the number of group .
def _radar_plotting(self, data, xlabel = '', ylabel = '', grp_label = '', fill_color = True, fontsize = 12):
            if isinstance(data, list) is True:
                data = np.array(data)
            if data.ndim == 1:
                data = np.expand_dims(data, axis=-1)
            pt_N = data.shape[0]
            grp_N = data.shape[1]
            if grp_label == '':
                grp_label = ['']*grp_N
            angles = [n/float(pt_N)*2*np.pi for n in range(pt_N)]
            angles += angles[:1]
            ax = plt.subplot(111, polar=True)
            ax.set_theta_offset(np.pi/2)
            ax.set_theta_direction(-1)
            plt.xticks(angles[:-1], xlabel, color = 'black', fontsize=fontsize)
            ax.set_rlabel_position(0)
            ax.set_ylabel(ylabel, color='black', fontsize=fontsize)
            if (np.min(data)<0) & (np.max(data)<0):
                ax.set_ylim([1.33*np.min(data), 0])
            elif (np.min(data)<0) & (np.max(data)>0):
                ax.set_ylim([1.33*np.min(data), 1.33*np.max(data)])
            else:
                ax.set_ylim([0, 1.33*np.max(data)])
            for i in range(grp_N):
                tmp_data = data[:,i].tolist()
                tmp_data += tmp_data[:1]
                ax.plot(angles, tmp_data, linewidth=1, linestyle='solid', label=grp_label[i])
                if fill_color is True:
                    ax.fill(angles, tmp_data, 'b', alpha=0.1)
            if grp_N > 1 & len(grp_label)>0:
                ax.legend(grp_label, loc=[0.9,0.9])
            if self._isshow is True: 
                plt.show()
def _radar_plotting ( self , data , xlabel = '' , ylabel = '' , grp_label = '' , fill_color = True , fontsize = 12 ) : if isinstance ( data , list ) is True : data = np . array ( data ) if data . ndim == 1 : data = np . expand_dims ( data , axis = - 1 ) pt_N = data . shape [ 0 ] grp_N = data . shape [ 1 ] if grp_label == '' : grp_label = [ '' ] * grp_N angles = [ n / float ( pt_N ) * 2 * np . pi for n in range ( pt_N ) ] angles += angles [ : 1 ] ax = plt . subplot ( 111 , polar = True ) ax . set_theta_offset ( np . pi / 2 ) ax . set_theta_direction ( - 1 ) plt . xticks ( angles [ : - 1 ] , xlabel , color = 'black' , fontsize = fontsize ) ax . set_rlabel_position ( 0 ) ax . set_ylabel ( ylabel , color = 'black' , fontsize = fontsize ) if ( np . min ( data ) < 0 ) & ( np . max ( data ) < 0 ) : ax . set_ylim ( [ 1.33 * np . min ( data ) , 0 ] ) elif ( np . min ( data ) < 0 ) & ( np . max ( data ) > 0 ) : ax . set_ylim ( [ 1.33 * np . min ( data ) , 1.33 * np . max ( data ) ] ) else : ax . set_ylim ( [ 0 , 1.33 * np . max ( data ) ] ) for i in range ( grp_N ) : tmp_data = data [ : , i ] . tolist ( ) tmp_data += tmp_data [ : 1 ] ax . plot ( angles , tmp_data , linewidth = 1 , linestyle = 'solid' , label = grp_label [ i ] ) if fill_color is True : ax . fill ( angles , tmp_data , 'b' , alpha = 0.1 ) if grp_N > 1 & len ( grp_label ) > 0 : ax . legend ( grp_label , loc = [ 0.9 , 0.9 ] ) if self . _isshow is True : plt . show ( )
Show radar chart
Parameters:
Show radar chart Parameters :
"""
            Show radar chart
        
            Parameters:
            ------------
            data: M*N series point, not recommend to read more than 3 groups in one radar chart. N means the number of group.
            xlabel: label in x-axis
            ylabel: label in y-axis
            grp_label: group label
            fill_color: whether fill radar with color (light blue)
            fontsize: fontsize
            """ # Background # Set theta direction and its offset # Draw xlabels # Draw ylabels # Add plots # Add legend
self
data
xlabel
ylabel
grp_label
fill_color
fontsize