code: def context_menu_requested(self, event):
          
          if self.fig:
              pos = QPoint(event.x(), event.y())
              context_menu = QMenu(self)
              context_menu.addAction(ima.icon('editcopy'), "Copy Image",
                                     self.copy_figure,
                                     QKeySequence(
                                         get_shortcut('plots', 'copy')))
              context_menu.popup(self.mapToGlobal(pos))
docs: Popup context menu.