def text(axes, gate_pos, wire_pos, textstr, plot_params):
    """
    Draws a text box on the figure.

    Args:
        axes (matplotlib.axes.Axes): axes object
        gate_pos (float): x coordinate of the gate [data units]
        wire_pos (float): y coordinate of the qubit wire
        textstr (str): text of the gate and box
        plot_params (dict): plot parameters
        box (bool): draw the rectangle box if box is True
    """
    return axes.text(gate_pos, wire_pos, textstr, color='k', ha='center',
        va='center', clip_on=True, size=plot_params['fontsize'])
