Exemple #1
0
 def _recompute_jittering_offsets(self):
     if not self._jittering:
         self._jittering_offsets = None
     elif self.data:
         # Calculate offsets randomly distributed within a circle
         screen_size = max(100, min(qApp.desktop().screenGeometry().width(),
                                    qApp.desktop().screenGeometry().height()))
         n = len(self.data)
         r = np.random.random(n)
         theta = np.random.uniform(0, 2*np.pi, n)
         xy_offsets = screen_size * self._jittering * np.c_[r * np.cos(theta),
                                                            r * np.sin(theta)]
         self._jittering_offsets = xy_offsets
Exemple #2
0
 def _recompute_jittering_offsets(self):
     if not self._jittering:
         self._jittering_offsets = None
     elif self.data:
         # Calculate offsets randomly distributed within a circle
         screen_size = max(100, min(qApp.desktop().screenGeometry().width(),
                                    qApp.desktop().screenGeometry().height()))
         n = len(self.data)
         r = np.random.random(n)
         theta = np.random.uniform(0, 2*np.pi, n)
         xy_offsets = screen_size * self._jittering * np.c_[r * np.cos(theta),
                                                            r * np.sin(theta)]
         self._jittering_offsets = xy_offsets