python - Matplotlib 图和轴背景颜色
问题描述
我想删除(红色和蓝色)或将轴和图形的颜色设置为透明(如下图)。我怎么能这样做?像 set_facecolor('transparent') 不起作用
这是我的代码:
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)
解决方案
推荐阅读
- unity3d - 为什么在 Unity 中静音如此困难?
- r - 在 R 中使用 Perl 正则表达式进行抓取
- matlab - ind2sub 在 3D 数组中查找值
- python - Python 中的 Mac OS、打开、刷新连接、保存和关闭 Excel 文件
- r - R Markdown message=FALSE 仍然会发出警告
- javascript - Google Maps Geometry Library:如何创建处于拖动状态的标记
- python - ModuleNotFoundError:没有名为“darkflow”的模块
- java - 从 JDateChooser 中选择的日期增量
- javascript - 等待所有文件更新,然后下载它们
- javascript - 为我的 JSON 构建一个包含行和列跨度的表