(self, always=False)
| 672 | self.recache(always=True) |
| 673 | |
| 674 | def recache(self, always=False): |
| 675 | if always or self._invalidx: |
| 676 | xconv = self.convert_xunits(self._xorig) |
| 677 | x = _to_unmasked_float_array(xconv).ravel() |
| 678 | else: |
| 679 | x = self._x |
| 680 | if always or self._invalidy: |
| 681 | yconv = self.convert_yunits(self._yorig) |
| 682 | y = _to_unmasked_float_array(yconv).ravel() |
| 683 | else: |
| 684 | y = self._y |
| 685 | |
| 686 | self._xy = np.column_stack(np.broadcast_arrays(x, y)).astype(float) |
| 687 | self._x = self._xy[:, 0] # views of the x and y data |
| 688 | self._y = self._xy[:, 1] |
| 689 | |
| 690 | self._subslice = False |
| 691 | if (self.axes |
| 692 | and len(x) > self._subslice_optim_min_size |
| 693 | and _path.is_sorted_and_has_non_nan(x) |
| 694 | and self.axes.name == 'rectilinear' |
| 695 | and self.axes.get_xscale() == 'linear' |
| 696 | and self._markevery is None |
| 697 | and self.get_clip_on() |
| 698 | and self.get_transform() == self.axes.transData): |
| 699 | self._subslice = True |
| 700 | nanmask = np.isnan(x) |
| 701 | if nanmask.any(): |
| 702 | self._x_filled = self._x.copy() |
| 703 | indices = np.arange(len(x)) |
| 704 | self._x_filled[nanmask] = np.interp( |
| 705 | indices[nanmask], indices[~nanmask], self._x[~nanmask]) |
| 706 | else: |
| 707 | self._x_filled = self._x |
| 708 | |
| 709 | if self._path is not None: |
| 710 | interpolation_steps = self._path._interpolation_steps |
| 711 | else: |
| 712 | interpolation_steps = 1 |
| 713 | if self._drawstyle == 'default': |
| 714 | vertices = self._xy |
| 715 | else: |
| 716 | step_func = STEP_LOOKUP_MAP[self._drawstyle] |
| 717 | vertices = np.asarray(step_func(*self._xy.T)).T |
| 718 | self._path = Path(vertices, _interpolation_steps=interpolation_steps) |
| 719 | self._transformed_path = None |
| 720 | self._invalidx = False |
| 721 | self._invalidy = False |
| 722 | |
| 723 | def _transform_path(self, subslice=None): |
| 724 | """ |
no test coverage detected