I wanted to update my code that annotates a plot by changed the deprecated keyword argument s to text as described in the documentation of matplotlib v3.1.1. However it fails to recognise text as an argument and requests s instead.
Fixed via the final removal of the deprecation #16491.
Luckily there was no further feedback on the inconsistency in 3.1, so we don't have to be too afraid that this will still be present in 3.2 and only be resolved in 3.3.
Activity
timhoffm commented on Aug 27, 2019
This issue is discussed in #15049.
ImportanceOfBeingErnest commented on Aug 27, 2019
Marking as release critical, because the documentation cannot state a parameter text, if that parameter does not exist.
timhoffm commented on Aug 29, 2019
The way forward (two possible solutions) is #15049 (comment).
tacaswell commented on Oct 15, 2019
Pushed to 3.3 as this issue does not break any existing code, but is an inconsistency that we should fix.
We should push out deprecating the s kwarg for at least one extra minor release after we clean this up.
timhoffm commented on Feb 16, 2020
Fixed via the final removal of the deprecation #16491.
Luckily there was no further feedback on the inconsistency in 3.1, so we don't have to be too afraid that this will still be present in 3.2 and only be resolved in 3.3.
SeaDude commented on Apr 8, 2020
What is the fix for us end users? Following this tutorial here...
I receive the error...
TypeError Traceback (most recent call last) <ipython-input-27-165dd014e247> in <module> 4 5 for idx, row in merged.iterrows(): ----> 6 plt.annotate(s=row['province'], xy=row['coords'], horizontalalignment='center') TypeError: annotate() missing 1 required positional argument: 'text'When attempting to run...
# Add Labels merged['coords'] = merged['geometry'].apply(lambda x: x.representative_point().coords[:]) merged['coords'] = [coords[0] for coords in merged['coords']] for idx, row in merged.iterrows(): plt.annotate(s=row['province'], xy=row['coords'], horizontalalignment='center')Thank you!
ksunden commented on Apr 8, 2020
@SeaDude See #15049, which is now merged, and ensures that the proper renaming is propegated (not yet released, but coming)
Alternatively, you can just take out the s=, as that is the first positional argument anyway
tacaswell commented on Apr 8, 2020
What version of Matplotlib are you using?
You can also change plt.annotate to ax.annotate. The random switching between the OO and sate machine APIs in that tutorial is very weird.