code/vexptoolbox/data.py
def plotAccuracy(self):
            """ Spatial plot of mean and median accuracy in dataset """
            fig = plt.figure()

            # One subplot per depth plane
            depths = []
            for t in self.targets:
                if t['d'] not in depths:
                    depths.append(t['d'])
            
            axs = {}
            c = 1
            for d in depths:
                ax = fig.add_subplot(1, len(depths), c)
                ax.set_title('Accuracy, d={:.1f}m'.format(d))
                ax.set_xlabel('Horizontal Position (degrees)')
                ax.set_ylabel('Vertical Position (degrees)')

                legend_handles = []
                for t in self.targets:
                    if t['d'] == d:
                        ax.plot(t['x'], t['y'], 'k+', markersize=12)
                        ax.plot([t['x'], t['avgX']], [t['y'], t['avgY']], 'r-', linewidth=1)
                        Hmean, = ax.plot(t['avgX'], t['avgY'], 'r.', markersize=10)
                        ax.plot([t['x'], t['medX']], [t['y'], t['medY']], 'b-', linewidth=1)
                        Hmedian, = ax.plot(t['medX'], t['medY'], 'b.', markersize=10)
                        ax.annotate('{:.2f}'.format(t['acc']), xy=(t['x'], t['y']), xytext=(0, 10),
                                    textcoords='offset points', ha='center')

                        if len(legend_handles) < 1:
                            legend_handles.append(Hmean)
                            legend_handles.append(Hmedian)

                ax.margins(x=0.15, y=0.15)
                ax.legend(legend_handles, ['mean', 'median'], ncol=2, bbox_to_anchor=(0, 0), loc='lower left')
                axs[d] = ax
                c += 1

            fig.show()
 Spatial plot of mean and median accuracy in dataset 
Spatial plot of mean and median accuracy in dataset
Spatial plot of mean and median accuracy in dataset
def plotAccuracy(self):
            fig = plt.figure()
            depths = []
            for t in self.targets:
                if t['d'] not in depths:
                    depths.append(t['d'])
            axs = {}
            c = 1
            for d in depths:
                ax = fig.add_subplot(1, len(depths), c)
                ax.set_title('Accuracy, d={:.1f}m'.format(d))
                ax.set_xlabel('Horizontal Position (degrees)')
                ax.set_ylabel('Vertical Position (degrees)')
                legend_handles = []
                for t in self.targets:
                    if t['d'] == d:
                        ax.plot(t['x'], t['y'], 'k+', markersize=12)
                        ax.plot([t['x'], t['avgX']], [t['y'], t['avgY']], 'r-', linewidth=1)
                        Hmean, = ax.plot(t['avgX'], t['avgY'], 'r.', markersize=10)
                        ax.plot([t['x'], t['medX']], [t['y'], t['medY']], 'b-', linewidth=1)
                        Hmedian, = ax.plot(t['medX'], t['medY'], 'b.', markersize=10)
                        ax.annotate('{:.2f}'.format(t['acc']), xy=(t['x'], t['y']), xytext=(0, 10),
                                    textcoords='offset points', ha='center')
                        if len(legend_handles) < 1:
                            legend_handles.append(Hmean)
                            legend_handles.append(Hmedian)
                ax.margins(x=0.15, y=0.15)
                ax.legend(legend_handles, ['mean', 'median'], ncol=2, bbox_to_anchor=(0, 0), loc='lower left')
                axs[d] = ax
                c += 1
            fig.show()
def plotAccuracy ( self ) : fig = plt . figure ( ) depths = [ ] for t in self . targets : if t [ 'd' ] not in depths : depths . append ( t [ 'd' ] ) axs = { } c = 1 for d in depths : ax = fig . add_subplot ( 1 , len ( depths ) , c ) ax . set_title ( 'Accuracy, d={:.1f}m' . format ( d ) ) ax . set_xlabel ( 'Horizontal Position (degrees)' ) ax . set_ylabel ( 'Vertical Position (degrees)' ) legend_handles = [ ] for t in self . targets : if t [ 'd' ] == d : ax . plot ( t [ 'x' ] , t [ 'y' ] , 'k+' , markersize = 12 ) ax . plot ( [ t [ 'x' ] , t [ 'avgX' ] ] , [ t [ 'y' ] , t [ 'avgY' ] ] , 'r-' , linewidth = 1 ) Hmean , = ax . plot ( t [ 'avgX' ] , t [ 'avgY' ] , 'r.' , markersize = 10 ) ax . plot ( [ t [ 'x' ] , t [ 'medX' ] ] , [ t [ 'y' ] , t [ 'medY' ] ] , 'b-' , linewidth = 1 ) Hmedian , = ax . plot ( t [ 'medX' ] , t [ 'medY' ] , 'b.' , markersize = 10 ) ax . annotate ( '{:.2f}' . format ( t [ 'acc' ] ) , xy = ( t [ 'x' ] , t [ 'y' ] ) , xytext = ( 0 , 10 ) , textcoords = 'offset points' , ha = 'center' ) if len ( legend_handles ) < 1 : legend_handles . append ( Hmean ) legend_handles . append ( Hmedian ) ax . margins ( x = 0.15 , y = 0.15 ) ax . legend ( legend_handles , [ 'mean' , 'median' ] , ncol = 2 , bbox_to_anchor = ( 0 , 0 ) , loc = 'lower left' ) axs [ d ] = ax c += 1 fig . show ( )
Spatial plot of mean and median accuracy in dataset
Spatial plot of mean and median accuracy in dataset
""" Spatial plot of mean and median accuracy in dataset """ # One subplot per depth plane
self