code: def _compute_secondary(self):
          
          # secondary y axis support
          if self.secondary_series and self._y_labels:
              y_pos = list(zip(*self._y_labels))[1]
              if self.include_x_axis:
                  ymin = min(self._secondary_min, 0)
                  ymax = max(self._secondary_max, 0)
              else:
                  ymin = self._secondary_min
                  ymax = self._secondary_max
              steps = len(y_pos)
              left_range = abs(y_pos[-1] - y_pos[0])
              right_range = abs(ymax - ymin) or 1
              scale = right_range / ((steps - 1) or 1)
              self._y_2nd_labels = [(self._y_format(ymin + i * scale), pos)
                                    for i, pos in enumerate(y_pos)]
  
              self._scale = left_range / right_range
              self._scale_diff = y_pos[0]
              self._scale_min_2nd = ymin
docs: Compute secondary axis min max and label positions