Search code examples
pyqtgraph

Removing export formats from pyqtgraph


I am trying to figure out how to remove an export format from the context menu when right clicking in a plot using pyqtgraph. I found the class but I have no idea how to remove any items from here, or altering the right-click menu at all. Any idea on where to start dissecting to get to a solution?


Solution

  • See here: https://groups.google.com/forum/#!topic/pyqtgraph/3jWiatJPilc

    There's some info relative to disabling the context menus, but also subclassing ViewBox to redefine some of them as well. I've also subclassed several of the items (GraphicsLayoutWidget, PlotItem..) to allow redefining the context menu for the PlotItems.

    The context menu is constructed from several sub-objects. The PlotItem and Viewbox each contribute to what you ultimately see. So finding the right level will be relative to what you're trying to accomplish.