1

For my app I'm trying to use matplotlib together with PyQt4. I tried to make the background of the matplotlib figures transparent as in Matplotlib / PyQT4: transparent figure However the result is this:

enter image description here while the background is like this:

enter image description here

It's like the background is rescaled in the matplotlib figure or a part of the background of the QWidget in PyQT4 is copied to another place. it's very difficult to make the code short. I will take 1 example from 1 graph:

 class MyMplCanvas(FigureCanvas):
     """Ultimately, this is a QWidget (as well as a FigureCanvasAgg)."""
     def __init__(self, parent=None):
         fig = Figure(facecolor='None',edgecolor='None')
         self.axes = fig.add_subplot(111,autoscale_on=False,axisbg='none')
         self.fig.patch.set_alpha(0)

The rest of the code is based on the example on Matplotlib http://matplotlib.org/examples/user_interfaces/embedding_in_qt4.html

I have not been able to solve this problem. So is it possible to make the background really transparent ?

Community
  • 1
  • 1
Driedan
  • 255
  • 1
  • 5
  • 12

0 Answers0