def METHOD_NAME(self, force_show=False):
    if not (force_show or self.always_show_symbols_legend):
        self.hide_legend()
        return
    num_captions = len(self.centers) + 1
    if num_captions != len(self.captions):
        self.clear_legend()
        fmt = "{0:0" + str(self.bits_per_symbol) + "b}"
        for i in range(num_captions):
            font = QFont()
            font.setPointSize(16)
            font.setBold(True)
            self.captions.append(self.addSimpleText(fmt.format(i), font))
    view_rect = self.parent().view_rect()  # type: QRectF
    padding = 0
    fm = QFontMetrics(self.captions[0].font())
    for i, caption in enumerate(self.captions):
        caption.show()
        scale_x, scale_y = util.calc_x_y_scale(self.separation_areas[i].rect(), self.parent())
        try:
            caption.setPos(view_rect.x() + view_rect.width() - fm.width(caption.text()) * scale_x,
                           self.centers[i] + padding)
        except IndexError:
            caption.setPos(view_rect.x() + view_rect.width() - fm.width(caption.text()) * scale_x,
                           self.centers[i - 1] - padding - fm.height() * scale_y)
        caption.setTransform(QTransform.fromScale(scale_x, scale_y), False)