The error message "AttributeError: 'PathCollection' object has no attribute 'subplots'" typically occurs when you try to call the subplots method on a PathCollection object, which does not have this method.
A PathCollection object is usually returned by the scatter method in Matplotlib when creating a scatter plot. It represents a collection of scatter plot markers.
看起来像是无意中,你的plt对象已经变成了PathCollection对象。另外,你也得确保确实已经添加了subplot().