Esempio n. 1
0
 def _set_patch(self):
     ax = self.ax
     kwargs = picker_kwargs(preferences.Plot.pick_tolerance)
     self.patch = [ax.axvline(self._pos[0],
                              color=self.color,
                              alpha=self.alpha,
                              **kwargs)]
Esempio n. 2
0
 def _set_patch(self):
     """Creates the line, and also creates the width indicators if
     appropriate.
     """
     self.ax.autoscale(False)  # Prevent plotting from rescaling
     xy = np.array(self._pos)
     max_r = max(self.radius_move, self.radius_resize, self.radius_rotate)
     kwargs = picker_kwargs(max_r)
     self.patch = [
         plt.Line2D(
             xy[:, 0],
             xy[:, 1],
             linestyle='-',
             lw=self.linewidth,
             c=self.color,
             alpha=self.alpha,
             marker='s',
             markersize=self.radius_resize,
             mew=0.1,
             mfc='lime',
             **kwargs,
         )
     ]
     if self._size[0] > 0:
         self._set_size_patch()
Esempio n. 3
0
 def _set_patch(self):
     ax = self.ax
     kwargs = picker_kwargs(5)
     self.patch = [ax.axhline(
         self._pos[0],
         color=self.color,
         alpha=self.alpha,
         **kwargs)]
Esempio n. 4
0
 def _set_size_patch(self):
     wc = self._get_width_indicator_coords()
     kwargs = picker_kwargs(self.radius_move)
     for i in range(2):
         wi, = self.ax.plot(wc[i][0],
                            wc[i][1],
                            linestyle=':',
                            animated=self.blit,
                            lw=self.linewidth,
                            c=self.color,
                            **kwargs)
         self.patch.append(wi)
         self._width_indicator_patches.append(wi)
Esempio n. 5
0
 def _set_size_patch(self):
     if self.ax is None:
         # The widget hasn't been fully added to an axis yet.
         return
     if self.axes[0].scale != self.axes[1].scale:
         raise ValueError("linewidth is not supported for axis with "
                          "different scale.")
     wc = self._get_width_indicator_coords()
     kwargs = picker_kwargs(self.radius_move)
     for i in range(2):
         wi = plt.Line2D(*wc[i].T,
                         linestyle=':',
                         lw=self.linewidth,
                         c=self.color,
                         **kwargs)
         self.patch.append(wi)
         self._width_indicator_patches.append(wi)