opsvis
opsvis copied to clipboard
"list index out of range" error when using big material tag numbers
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()