Yan Tijin
Yan Tijin

Reputation: 181

AttributeError: 'AxesSubplot' object has no attribute 'hold'

I change a new computer and install Python3.6 and matplotlib,When I run the code last month in the old computer, I get the following error: ax.hold(True) AttributeError: 'AxesSubplot' object has no attribute 'hold'

Upvotes: 6

Views: 8694

Answers (2)

user14006802
user14006802

Reputation: 31

The API Changes document says: Setting or unsetting hold (deprecated in version 2.0) has now been completely removed. Matplotlib now always behaves as if hold=True. To clear an axes you can manually use cla(), or to clear an entire figure use clf().

Upvotes: 3

Yan Tijin
Yan Tijin

Reputation: 181

The Axes.hold method was deprecated since 2.0 and was removed in matplotlib3.0:

Deprecated since version 2.0: axes.hold is deprecated. See the API Changes document (http://matplotlib.org/api/api_changes.html) for more details.

Upvotes: 8

Related Questions