-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Open
Description
Describe the Error
When I was running:
addpt = plt_one_addpt_onclick(x_train, y_train, w_in, b_in, logistic=False)
the following error occurred:
AttributeError Traceback (most recent call last)
Cell In[4], [line 4](vscode-notebook-cell:?execution_count=4&line=4)
2 b_in = 0
3 plt.close('all')
----> [4]addpt = plt_one_addpt_onclick( x_train,y_train, w_in, b_in, logistic=False)
File ~/Machine-Learning-Specialization-Coursera/C1 - Supervised Machine Learning - Regression and Classification/week3/Optional Labs/plt_one_addpt_onclick.py:66, in plt_one_addpt_onclick.__init__(self, x, y, w, b, logistic)
64 self.bthresh = CheckButtons(axthresh, ('Toggle 0.5 threshold (after regression)',))
65 self.bthresh.on_clicked(self.thresh)
---> [66]self.resize_sq(self.bthresh)
File ~/Machine-Learning-Specialization-Coursera/C1 - Supervised Machine Learning - Regression and Classification/week3/Optional Labs/plt_one_addpt_onclick.py:200, in plt_one_addpt_onclick.resize_sq(self, bcid)
170 """ resizes the check box """
171 # future reference
172 # print(f"width : {bcid.rectangles[0].get_width()}")
173 # print(f"height : {bcid.rectangles[0].get_height()}")
(...) 197 # bcid._lines[0][0].set_ydata([ymax, ymin])
198 # bcid._lines[0][1].set_ydata([ymin, ymax])
--> [200] h = bcid.rectangles[0].get_height()
201 bcid.rectangles[0].set_height(3 * h)
203 ymax = bcid.rectangles[0].get_bbox().y1
AttributeError: 'CheckButtons' object has no attribute 'rectangles'
Expected behavior
it runs normally and outputs an interactive image.
Environment:
- OS: Mac OS (15.6.1)
- VS Code: 1.105.1
- jupyter core: 5.8.1
- Python: 3.13.2
- matplotlib: 3.10.0
Metadata
Metadata
Assignees
Labels
No labels