Open thedannymarsh opened 5 months ago
This is likely related to the deprecated matplotlib attribute legendHandles
- replaced by legend_handles
- since the error above is preceded by an AtributeError:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[17], line 27
24 ax.add_artist(d)
26 leg = ax.legend([a, b, c, d], ['a', 'b', 'c', 'd'], handlelength = 0, fontsize = 20, loc = 'upper left')
---> 27 for handle, label in zip(leg.legendHandles, leg.texts):
28 label.set_color(handle.get_facecolor())
29 handle.set_visible(False)
AttributeError: 'Legend' object has no attribute 'legendHandles'
Running the notebook in Google Collab (defaulting to an earlier version of matplotlib) I get the following:
MatplotlibDeprecationWarning: The legendHandles attribute was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use legend_handles instead.
for handle, label in zip(leg.legendHandles, leg.texts):
This also applies to the Python code in Interactive Demo: Linear combination of vectors
Section 2.1 has an error: