Search code examples
pythonpyqtgraph

How to disable the default context menu of pyqtgraph?


Can anyone help me to disable the context menu of pyqtgraph or remove some options from it?


Solution

  • Use the PlotItem.setMenuEnabled method. Something like:

        self.plot = pg.PlotItem()
        self.plot.setMenuEnabled(False)
    

    I have not found a way to remove options from it but perhaps it's possible. I would be interested in this as well.