python三维绘图 画长方体,Python Matplotlib-绘制长方体

I'm trying to plot cuboids of different sizes using matplotlib, such that: after rotation the cuboids do not overlap visually in a non-physical way, the cubes have different colors and a box drawn around them.

I've read several blog posts and stackoverflow pages referencing similar problems, but always with a slight difference; none which have worked for me. The easiest way to overcome the overlapping problem was to use voxels (as in https://matplotlib.org/api/_as_gen/mpl_toolkits.mplot3d.axes3d.Axes3D.html?highlight=voxel#mpl_toolkits.mplot3d.axes3d.Axes3D.voxels), but these do not allow me to draw boxes around them. What's the easiest way to do this in matplotlib?

The image below shows what I have on the left, and what I want on the right.

EDIT:

I've looked into several approaches that can give the desired effect, of which the main ones are:

<
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值