From f7451cbf38d8d8335bd736c73bb12e8724aa7433 Mon Sep 17 00:00:00 2001 From: yangwy811 Date: Thu, 2 May 2024 10:45:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmatplotlib=203.6.3=E4=B8=8B?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E7=BB=98=E5=88=B63D=E6=95=A3=E7=82=B9?= =?UTF-8?q?=E5=9B=BE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将self.ax = Axes3D(self.fig)替换为self.ax = self.fig.add_subplot(111, projection='3d'), 解决了在matplotlib 3.6.3版本中无法正常绘制3D散点图的问题。 --- geatpy/visualization/PointScatter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geatpy/visualization/PointScatter.py b/geatpy/visualization/PointScatter.py index a1600bd3..2b766d06 100644 --- a/geatpy/visualization/PointScatter.py +++ b/geatpy/visualization/PointScatter.py @@ -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]