Bug
notebooks/all_models.ipynb cell 21 fails with newer matplotlib versions:
ValueError: label must be scalar or have the same length as the input data, but found 2 for 1 datasets.
Root cause
The S-parameter dict keys are tuples (e.g. ("o1", "o2")). When passed directly as label=key, newer matplotlib interprets the tuple as a sequence of labels and expects one per dataset:
for key in S:
plt.plot(f / 1e9, abs(S[key]) ** 2, label=key) # key is ("o1", "o2") — fails
Fix
Convert the tuple to a string:
for key in S:
plt.plot(f / 1e9, abs(S[key]) ** 2, label=str(key))
Bug
notebooks/all_models.ipynbcell 21 fails with newer matplotlib versions:Root cause
The S-parameter dict keys are tuples (e.g.
("o1", "o2")). When passed directly aslabel=key, newer matplotlib interprets the tuple as a sequence of labels and expects one per dataset:Fix
Convert the tuple to a string: