title: Matplotlib wxWidget plot missing button images on Cygwin
body: <p>Screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/Fsstp.png" alt="enter image description here"></p>
  
  <p>What can be cause for this issue: is it Cygwin issue, or wx/wxPython issue, or Matplotlib issue?</p>
  
  <p>Other than this error popping about missing button images on every plot, everything works fine</p>
  
  <hr>
  
  <p>Day after: As I <a href="http://gnuradio.org/redmine/projects/gnuradio/wiki/WxPythonCygwin" rel="nofollow noreferrer">compiled</a> wx to use native Windows graphic interface (no need to install X server and gtk) it's basically Windows compile (not Cygwin compile) so it does not understand Cygwin POSIX paths while Cygwin packages can use it.</p>
  
  <p>It's not just MPL that has problems this way but any wx package that passes Cygwin resource as filename to wx. One workaround is to pass python object instead path, so for above example this can be workaround like this:</p>
  
  <p>Matplotlib uses <code>_load_bitmap(filename as str)</code> function to pass those buttons graphics to wx through <code>wx.Bitmap(filename)</code>. Patching <code>backend_wx.py</code> like this:</p>
  
  <pre><code>#   bmp = wx.Bitmap(bmpFilename)
  
      wxf = open(bmpFilename, 'rb')
      bmp = wx.BitmapFromImage(wx.ImageFromStream(wxf, wx.BITMAP_TYPE_ANY))
      wxf.close()
  </code></pre>
  
  <p>resolves this for Matplotlib and runs without issues</p>
  
  <p>I'm interested in more robust solution that would work for all wx applications</p>