TypeError: stem() got an unexpected keyword argument 'use_line_collection'

plt.subplot(122); plt.stem(x, y, use_line_collection=True)
I have the above error after running this code. I am using Python3.12 and have updated matplotlib to version 3.8.3. How can I solve this problem

That was removed in 3.8; it’s always True now.
https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.8.0.html#stem-use-line-collection-false