0

I added a toolbar button with an icon as explained here: Add toolbar button icon matplotlib. It worked for a while, then it stopped and I am at a loss to understand why. It just shows the name now. Can someone explain what the 'r' is for before the image filename? I've also tried sending in the whole path to the image file with and without the 'r' - it still didn't work. Thank you!

Here's the code:

class zoominTool(ToolBase):
  '''zoomin by 10%'''
  default_keymap='+'
  description = 'Zoom in 10 percent'
  image = r'./zoomin.png'
  name = '+'
lmp
  • 1

1 Answers1

0

I figured it out, kind of. I tried changing the backends. If I set it to TkAgg, my icons appear. If I set it to Qt4Agg or Qt5Agg, I get text.

import matplotlib
matplotlib.use('TkAgg')
Tyler2P
  • 2,324
  • 26
  • 22
  • 31
lmp
  • 1