0

I want to remove(red and blue) or set as transparent the color of axis and figure (such as below image). How could I do this? like set_facecolor('transparent') is not working

here is my code:

    self.fig = Figure(figsize=(8, 7.5), dpi=55)
    self.fig.patch.set_facecolor('blue')
    self.fig.patch.set_alpha(1)

    FigureCanvas.__init__(self, self.fig)
    self.setParent(parent)
    self.ax6 = self.figure.add_subplot(111, projection='3d')
    # self.ax6.patch.set_alpha(.5)
    self.ax6.set_facecolor('red')
    m1 = mesh.Mesh.from_file('naberhaci.stl')
    m1.rotate([1, 0, 0], math.radians(00))
    self.ax6.add_collection3d(mplot3d.art3d.Poly3DCollection(m1.vectors))
    scale = m1.points.flatten()
    self.ax6.auto_scale_xyz(scale-10, scale+10, scale)

enter image description here

phzdjz
  • 79
  • 7
  • Does this answer your question? [How to set opacity of background colour of graph wit Matplotlib](https://stackoverflow.com/questions/4581504/how-to-set-opacity-of-background-colour-of-graph-wit-matplotlib) – JohanC Jul 15 '20 at 22:49
  • `set_facecolor('none')` would remove the background color on screen. `savefig('.....png', transparent=True)` would remove it for saved images. – JohanC Jul 15 '20 at 22:51
  • sorry it is not working on showing interface. I used the `fig.patch.set_alpha(0) ` . It is working. Thank you answers – phzdjz Jul 16 '20 at 07:01

0 Answers0