matplotlib 3d polycollection的x轴改变

时间:2018-01-18 11:24:58

标签: python matplotlib

使用matplotlib 3d polycollection(https://matplotlib.org/examples/mplot3d/polys3d_demo.html)创建图形。

我更改了x轴范围,但与2d图不同,轴范围外的数据仍然可见。有没有办法改变这一点而不改变数据?

我的图表:enter image description here

我的代码:

fig = plt.figure()
axes = fig.gca(projection='3d')
palette_1 = sns.color_palette("husl", (num_colours))

poly = PolyCollection(verts, edgecolors = 'black', facecolors = palette_1)
poly.set_alpha(0.7)
axes.add_collection3d(poly, zs = z_set, zdir = 'y')


x_min = float(5)
x_max = float(25)
axes.set_xlim3d(x_min, x_max)  

axes.set_ylim3d(10, 60)

axes.set_zlabel('Intensity (%)')
axes.set_zlim3d(0, 100)

0 个答案:

没有答案