def __init__(self, parent, transformation, scaleDivision, logger=None): super(ColorScaleWidget, self).__init__() self.titleWidget = ColorTitleWidget("Scale Widget Title", self) self.scaleBar = ColorScaleBar(self, transformation, scaleDivision) plotLayout = QtWidgets.QGridLayout() plotLayout.setSpacing(0) plotLayout.setContentsMargins(0, 0, 0, 0) plotLayout.addWidget(self.scaleBar, 0, 0) plotLayout.addWidget(self.titleWidget, 0, 1) self.setLayout(plotLayout)