0

I'm using matplotlib to plot 3D triangulated surface. However even if didn't define any alpha value the plot is semi transparent. I would like to make it completely opaque.

dataset is the array storing the mesh information.

norm = matplotlib.colors.Normalize()
fvalue=np.zeros(np.size(dataset.tri,0))

for i in range(0,np.size(dataset.tri,0)):
    tri=dataset.tri[i]
    fvalue[i]=dataset.var['T'][0,int(tri[0])]
colors = custom_colormap(norm(fvalue))

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
p3dc = ax.plot_trisurf(dataset.coord[0], dataset.coord[1],dataset.coord[2], triangles=dataset.tri)
p3dc.set_fc(colors)

plt.show()

enter image description here

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Yann
  • 67
  • 9
  • See https://stackoverflow.com/q/39144482/7758804 – Trenton McKinney Aug 31 '23 at 07:24
  • Seems so this is a bug with no solution? – Yann Aug 31 '23 at 12:35
  • Matplotlib's 3d capabilities are limited, e.g. it uses a layered approach to mask hidden parts. Further, `plot_trisurf` is meant to draw a surface where the height z is a function of x and y, so it doesn't really support closed surfaces. The matplotlib documentation suggests looking into the Mayavi library if you need better 3d quality. – JohanC Aug 31 '23 at 17:00
  • Did you try `edgecolor='none', linewidth=0, antialiased=False` as suggested in [this post](https://stackoverflow.com/questions/25476344/matplotlib-plot-trisurf-without-edges)? – JohanC Aug 31 '23 at 17:03

0 Answers0