Skip to content

Add "copy to clipboard" to the Toolbar #1987

Closed
@ryggyr

Description

@ryggyr

Wishlist: a "copy image to clipboard" button in the Toolbar for interactive backends.

For the wx backend, I've had some success with adding such a button by altering the function matplotlib.backends.NavigationToolbar2Wx._init_toolbar() in backend_wx.py so that the last line:

self.Realize()

is replaced by:

    _NTB2_COPY = wx.NewId()
    self.AddSimpleTool(_NTB2_COPY, _load_bitmap('stock_up.xpm'),
                        'Copy', 'Copy plot image to clipboard') 
    bind(self, wx.EVT_TOOL, self.copy, id=_NTB2_COPY) 

    self.Realize()

def copy(self, evt):
    self.canvas.Copy_to_Clipboard(event=evt) # bmp image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions