(points)
return extent
Compute bounds on a space with appropriate padding
Compute bounds on a space with appropriate padding
Compute bounds on a space with appropriate padding
def _get_extent(points):
    """Compute bounds on a space with appropriate padding"""
    min_x = np.nanmin(points[:, 0])
    max_x = np.nanmax(points[:, 0])
    min_y = np.nanmin(points[:, 1])
    max_y = np.nanmax(points[:, 1])

    extent = (
        np.round(min_x - 0.05 * (max_x - min_x)),
        np.round(max_x + 0.05 * (max_x - min_x)),
        np.round(min_y - 0.05 * (max_y - min_y)),
        np.round(max_y + 0.05 * (max_y - min_y)),
    )

    return extent
def _get_extent ( points ) : min_x = np . nanmin ( points [ : , 0 ] ) max_x = np . nanmax ( points [ : , 0 ] ) min_y = np . nanmin ( points [ : , 1 ] ) max_y = np . nanmax ( points [ : , 1 ] ) extent = ( np . round ( min_x - 0.05 * ( max_x - min_x ) ) , np . round ( max_x + 0.05 * ( max_x - min_x ) ) , np . round ( min_y - 0.05 * ( max_y - min_y ) ) , np . round ( max_y + 0.05 * ( max_y - min_y ) ) , ) return extent