def adjust_annotations_shifts(fig, x_factor=1.0, y_factor=1.0):
    """ Adjust annotation shifts.

    Arguments:
        fig (plotly.graph_objs._figure.Figure): Plotly figure.
        x_factor (float): The X shifts are multiplied with this factor.
        y_factor (float): The Y shifts are multiplied with this factor.
    """
    attrs = ['xshift', 'yshift']
    factors = [x_factor, y_factor]
    annotations = getattr(fig.layout, 'annotations', [])
    for annotation in annotations:
        for attr, factor in zip(attrs, factors):
            if getattr(annotation, attr, None) is not None:
                annotation[attr] *= factor
