def unscale_mb(m, b, factor_x, factor_y):
    """Unscale the slope and intercept of a linear fit that was performed to
       data that was rescaled."""
    # x * factor_x * m = y * factor_y --> y / x = ...
    m_real = m * factor_x / factor_y
    # b = y * factor_y --> y = ...
    b_real = b / factor_y
    return m_real, b_real