code/vexptoolbox/data.py
def plotPrecision(self, measure='sd'):
            """ Spatial plot of individual samples and SD precision in dataset 
            
            Args:
                measure (str): 'sd' or 'rmsi'
            """
            if measure not in ['sd', 'rmsi']:
                raise ValueError('Invalid measure specified.')
            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('Precision ({:s}), d={:.1f}m'.format(measure, d))
                ax.set_xlabel('Horizontal Position (degrees)')
                ax.set_ylabel('Vertical Position (degrees)')

                for idx, t in enumerate(self.targets):
                    sam = self.samples[idx]
                    if t['d'] == d:
                        ax.plot(t['x'], t['y'], 'k+', markersize=12)
                        tar_samX = []
                        tar_samY = []
                        for s in sam:
                            tar_samX.append(s['targetGaze_X'])
                            tar_samY.append(s['targetGaze_Y'])
                        ax.plot(tar_samX, tar_samY, '.',  markersize=3)
                        ax.plot(t['avgX'], t['avgY'], 'k.', markersize=6)
                        ax.annotate('{:.2f}'.format(t[measure]), xy=(t['x'], t['y']), xytext=(0, 10),
                                    textcoords='offset points', ha='center')

                ax.margins(x=0.15, y=0.15)
                axs[d] = ax
                c += 1

            fig.show()
 Spatial plot of individual samples and SD precision in dataset 
            
            Args:
                measure (str): 'sd' or 'rmsi'
            
Spatial plot of individual samples and SD precision in dataset
Spatial plot of individual samples and SD precision in dataset
def plotPrecision(self, measure='sd'):
            if measure not in ['sd', 'rmsi']:
                raise ValueError('Invalid measure specified.')
            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('Precision ({:s}), d={:.1f}m'.format(measure, d))
                ax.set_xlabel('Horizontal Position (degrees)')
                ax.set_ylabel('Vertical Position (degrees)')
                for idx, t in enumerate(self.targets):
                    sam = self.samples[idx]
                    if t['d'] == d:
                        ax.plot(t['x'], t['y'], 'k+', markersize=12)
                        tar_samX = []
                        tar_samY = []
                        for s in sam:
                            tar_samX.append(s['targetGaze_X'])
                            tar_samY.append(s['targetGaze_Y'])
                        ax.plot(tar_samX, tar_samY, '.',  markersize=3)
                        ax.plot(t['avgX'], t['avgY'], 'k.', markersize=6)
                        ax.annotate('{:.2f}'.format(t[measure]), xy=(t['x'], t['y']), xytext=(0, 10),
                                    textcoords='offset points', ha='center')
                ax.margins(x=0.15, y=0.15)
                axs[d] = ax
                c += 1
            fig.show()
def plotPrecision ( self , measure = 'sd' ) : if measure not in [ 'sd' , 'rmsi' ] : raise ValueError ( 'Invalid measure specified.' ) 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 ( 'Precision ({:s}), d={:.1f}m' . format ( measure , d ) ) ax . set_xlabel ( 'Horizontal Position (degrees)' ) ax . set_ylabel ( 'Vertical Position (degrees)' ) for idx , t in enumerate ( self . targets ) : sam = self . samples [ idx ] if t [ 'd' ] == d : ax . plot ( t [ 'x' ] , t [ 'y' ] , 'k+' , markersize = 12 ) tar_samX = [ ] tar_samY = [ ] for s in sam : tar_samX . append ( s [ 'targetGaze_X' ] ) tar_samY . append ( s [ 'targetGaze_Y' ] ) ax . plot ( tar_samX , tar_samY , '.' , markersize = 3 ) ax . plot ( t [ 'avgX' ] , t [ 'avgY' ] , 'k.' , markersize = 6 ) ax . annotate ( '{:.2f}' . format ( t [ measure ] ) , xy = ( t [ 'x' ] , t [ 'y' ] ) , xytext = ( 0 , 10 ) , textcoords = 'offset points' , ha = 'center' ) ax . margins ( x = 0.15 , y = 0.15 ) axs [ d ] = ax c += 1 fig . show ( )
Spatial plot of individual samples and SD precision in dataset
Spatial plot of individual samples and SD precision in dataset
""" Spatial plot of individual samples and SD precision in dataset 
            
            Args:
                measure (str): 'sd' or 'rmsi'
            """ # One subplot per depth plane
self
measure
'sd' or 'rmsi'
' sd ' or ' rmsi '