Skip to content

Add "copy to clipboard" to the Toolbar #1987

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy