Open jordan-gleeson opened 4 weeks ago
Hi,
I am not a developer, so this is a crude work-around, but in the plotters utility function, plot_surface
in plotters.py
, I was able to get an animation by editing the lines that initialize the figure.
I changed
to
if canvas is None:
fig, ax = plt.subplots(1, 1, figsize=designer.figsize, subplot_kw={"projection":"3d"})
else:
fig, ax = canvas
# Initialize 3D-axis
# ax = Axes3D(fig)
and it worked, though the plot is a bit uglier.
https://github.com/ljvmiranda921/pyswarms/assets/131929434/61d5cad1-17b8-45d6-8885-7377deab9370
Describe the bug Plotting in 3D space appears to be broken. The example in visualization.ipynb returns an empty 2D plot.
To Reproduce Open visualization.ipynb and run all code, then view plot1.gif.
Expected behavior A 3D visualization of the sphere optimization example.
Environment (please complete the following information):