sewkokot / opsvis

OpenSeesPy postprocessing and plotting module
GNU General Public License v3.0
35 stars 21 forks source link

"list index out of range" error when using big material tag numbers #26

Open mnadhro opened 2 years ago

mnadhro commented 2 years ago

This error happens when using big material tag numbers that are larger than the size of matcolor list. Sometimes using this kind of tags (101, 102 …) is useful for recognizing materials, elements, sections …etc. However, the matcolor list could not be that long, obviously, which lead to this error.

This is a small example.

import matplotlib.pyplot as plt
import opsvis

matTag = 101
fiber_section_ = [
                 ['section', 'Fiber', 1, '-GJ', 1e9],
                 ["patch", 'rect', matTag, 2, 10, *[-200, -300]  , *[200, 300]],
]

matcolor = ['c',]
opsvis.plot_fiber_section(fiber_section_, matcolor=matcolor)
plt.axis('equal')
plt.show()