Skip to content

Commit

Permalink
修复matplotlib 3.6.3下无法绘制3D散点图问题
Browse files Browse the repository at this point in the history
将self.ax = Axes3D(self.fig)替换为self.ax = self.fig.add_subplot(111, projection='3d'),
解决了在matplotlib 3.6.3版本中无法正常绘制3D散点图的问题。
  • Loading branch information
yangwy811 committed May 2, 2024
1 parent 8ffc093 commit f7451cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion geatpy/visualization/PointScatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def draw(self):
elif self.Dimension == 3:
if self.fig is None and self.ax is None:
self.fig = plt.figure() # 生成一块画布
self.ax = Axes3D(self.fig) # 创建绘图区域
self.ax = self.fig.add_subplot(111, projection='3d') # 创建绘图区域
self.ax.view_init(elev=30, azim=45) # 旋转
for idx, data in enumerate(self.data_set):
params = self.params_set[idx]
Expand Down

0 comments on commit f7451cb

Please sign in to comment.