def update_plot_limits(ax, white_space):
if hasattr(ax, '<STR_LIT>'):<EOL><INDENT>bounds = ax.xy_dataLim.bounds<EOL>ax.set_xlim(bounds[<NUM_LIT:0>] - white_space, bounds[<NUM_LIT:0>] + bounds[<NUM_LIT:2>] + white_space)<EOL>ax.set_ylim(bounds[<NUM_LIT:1>] - white_space, bounds[<NUM_LIT:1>] + bounds[<NUM_LIT:3>] + white_space)<EOL>bounds = ax.zz_dataLim.bounds<EOL>ax.set_zlim(bounds[<NUM_LIT:0>] - white_space, bounds[<NUM_LIT:0>] + bounds[<NUM_LIT:2>] + white_space)<EOL><DEDENT>else:<EOL><INDENT>bounds = ax.dataLim.bounds<EOL>assert not any(map(np.isinf, bounds)), '<STR_LIT>'<EOL>ax.set_xlim(bounds[<NUM_LIT:0>] - white_space, bounds[<NUM_LIT:0>] + bounds[<NUM_LIT:2>] + white_space)<EOL>ax.set_ylim(bounds[<NUM_LIT:1>] - white_space, bounds[<NUM_LIT:1>] + bounds[<NUM_LIT:3>] + white_space)<EOL><DEDENT>
Sets the limit options of a matplotlib plot.

    Args:
        ax: matplotlib axes
        white_space(float): whitespace added to surround the tight limit of the data

    Note: This relies on ax.dataLim (in 2d) and ax.[xy, zz]_dataLim being set in 3d