About ops_vis

Forum for asking and answering questions related to use of the OpenSeesPy module

Moderators: silvia, selimgunay, Moderators

Post Reply
shiro
Posts: 59
Joined: Tue May 26, 2020 1:19 am

About ops_vis

Post by shiro » Wed Jun 30, 2021 1:51 pm

Hello.

When I run the following example file, I get the following error:

https://openseespydoc.readthedocs.io/en ... ps-vis-ex2


Traceback (most recent call last):
File "demo_cantilever_3el_3d.py", line 69, in <module>
opsv.plot_model()
File "D:\Python38\lib\site-packages\openseespy\postprocessing\ops_vis.py", line 758, in plot_model
_plot_model_3d(node_labels, element_labels, offset_nd_label, axis_off,
File "D:\Python38\lib\site-packages\openseespy\postprocessing\ops_vis.py", line 706, in _plot_model_3d
ax.set_box_aspect((np.ptp(ax.get_xlim3d()),
AttributeError: 'Axes3DSubplot' object has no attribute 'set_box_aspect'


I would appreciate it if you could let me know.

skypass
Posts: 15
Joined: Thu May 27, 2021 9:37 am

Re: About ops_vis

Post by skypass » Sat Jul 03, 2021 11:56 pm

Hi.
I do confirm the bug. By shortly calling the code demo.py, my output is as follows:

Code: Select all

C:\Training>python demo.py
Traceback (most recent call last):
  File "demo.py", line 69, in <module>
    opsv.plot_model()
  File "C:\Users\Alfabeta\AppData\Local\Programs\Python\Python38\lib\site-packages\openseespy\postprocessing\ops_vi
s.py", line 758, in plot_model
    _plot_model_3d(node_labels, element_labels, offset_nd_label, axis_off,
  File "C:\Users\Alfabeta\AppData\Local\Programs\Python\Python38\lib\site-packages\openseespy\postprocessing\ops_vi
s.py", line 706, in _plot_model_3d
    ax.set_box_aspect((np.ptp(ax.get_xlim3d()),
AttributeError: 'Axes3DSubplot' object has no attribute 'set_box_aspect'
Unfortunately, several scripts of the guide fail. Further details about the said statement? Please, contact me directly through the mail box zipped below:

Code: Select all

https://transfer.sh/1xCxtx3/address.rar
Cheers

rafal
Posts: 51
Joined: Sun Feb 22, 2015 5:58 am

Re: About ops_vis

Post by rafal » Sun Jul 04, 2021 3:48 am

What version of matplotlib you are using? I use matplotlib ver. 3.3.4 and it works.

set_box_aspect option has been added to matplotlib 3.3, so you need at least this version to make it work.
https://matplotlib.org/stable/users/pre ... pect-ratio

skypass
Posts: 15
Joined: Thu May 27, 2021 9:37 am

Re: About ops_vis

Post by skypass » Sun Jul 04, 2021 9:36 pm

Good drift.
By installing the last release of matplotlib

Code: Select all

    Uninstalling matplotlib-3.2.0:
      Successfully uninstalled matplotlib-3.2.0
Successfully installed matplotlib-3.4.2 pillow-8.3.0
the script works fine, as per next screenshot. Thanks
Nevertheless, as said previously (where I left my email address), other bugs arise and I'ld like to discuss privately with someone of forum users.

Image

Cheers

shiro
Posts: 59
Joined: Tue May 26, 2020 1:19 am

Re: About ops_vis

Post by shiro » Mon Jul 05, 2021 1:11 am

Dear rafal and skypass


I use matplotlib ver. 3.2.1.

I updated to ver3.3.4 and it was successful.

Thank you for your advice.

Post Reply