def transform(self, tr):
    xy = np.empty(tr.shape, np.float_)
    if (self._axis is not None):
        if self._use_rmin:
            rmin = self._axis.viewLim.ymin
        else:
            rmin = 0
        theta_offset = self._axis.get_theta_offset()
        theta_direction = self._axis.get_theta_direction()
    else:
        rmin = 0
        theta_offset = 0
        theta_direction = 1
    t = tr[:, 0:1]
    r = tr[:, 1:2]
    x = xy[:, 0:1]
    y = xy[:, 1:2]
    t *= theta_direction
    t += theta_offset
    if (rmin != 0):
        r = (r - rmin)
        mask = (r < 0)
        x[:] = np.where(mask, np.nan, (r * np.cos(t)))
        y[:] = np.where(mask, np.nan, (r * np.sin(t)))
    else:
        x[:] = (r * np.cos(t))
        y[:] = (r * np.sin(t))
    return xy
def transform(self, tr):
    xy = np.empty(tr.shape, np.float_)
    if (self._axis is not None):
        if self._use_rmin:
            rmin = self._axis.viewLim.ymin
        else:
            rmin = 0
        theta_offset = self._axis.get_theta_offset()
        theta_direction = self._axis.get_theta_direction()
    else:
        rmin = 0
        theta_offset = 0
        theta_direction = 1
    t = tr[:, 0:1]
    r = tr[:, 1:2]
    x = xy[:, 0:1]
    y = xy[:, 1:2]
    t *= theta_direction
    t += theta_offset
    if (rmin != 0):
        r = (r - rmin)
        mask = (r < 0)
        x[:] = np.where(mask, np.nan, (r * np.cos(t)))
        y[:] = np.where(mask, np.nan, (r * np.sin(t)))
    else:
        x[:] = (r * np.cos(t))
        y[:] = (r * np.sin(t))
    return xy