2024-04-20 05:44:24 发布
网友
代码:
b=qt.Bloch(axes=a) pnt = [px[:],py[:],pz[:]] b.add_points(pnt) # b.fig = plt.subplot(326) plt.title('Bloch sphere')
此代码创建小的起始图形,但它是空的。 See screenshot of the result
将Bloch sphere显示为单独的图形效果良好。在
Render函数在show()之前是必需的。 必须为创建Bloch实例和调用render指定参数(fig和axes)。在
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D fig = plt.figure() ax = subplot('211', projection='3d') b = qt.Bloch(fig=fig, axes=ax) b.render(fig=fig, axes=ax) plt.show()
Render函数在show()之前是必需的。 必须为创建Bloch实例和调用render指定参数(fig和axes)。在
相关问题 更多 >
编程相关推荐