class_docstr: Widget displaying an editable color gradient. The user may add, move, recolor,
  or remove colors from the gradient. Additionally, a context menu allows the 
  user to select from pre-defined gradients.
code: def setMaxDim(self, mx=None):
      if mx is None:
          mx = self.maxDim
      else:
          self.maxDim = mx
  
      if self.orientation in ["bottom", "top"]:
          self.setFixedHeight(mx)
          self.setMaximumWidth(16777215)
      else:
          self.setFixedWidth(mx)
          self.setMaximumHeight(16777215)
  
file_path: pyqtgraph/pyqtgraph/widgets/GradientWidget.py
imports: from ..graphicsItems.GradientEditorItem import GradientEditorItem
  from ..Qt import QtCore, QtGui, QtWidgets
  from .GraphicsView import GraphicsView
label_desc: Use image node_id 3 for calling the GradientWidget obj's underlying member method code with example usage: obj.setMaxDim(mx) without return types