Jupyter notebook problem (matplotlib)

matplotlib doesn’t work
and i got this message instead (Canvas(toolbar=Toolbar(toolitems=[(‘Home’, ‘Reset original view’, ‘home’, ‘home’), (‘Back’, 'Back to previous …)

whenever i run a code similar to

fig,ax = plt.subplots(1,1,figsize=(4,4))
plot_data(X, y, ax)

ax.axis([0, 4, 0, 3.5])
ax.set_ylabel(‘x_1’)
ax.set_xlabel(‘x_0’)
plt.show()

Hi there, thanks for the question. It seems to be a problem with matplotlib widget, here’s a link containing several solutions. I would suggest that restart the kernel, please keep me posted to see if it works.
Regards,
Kezhen

1 Like

Thanks for replying Kezhen
unfortunately nothing works , i 've tried a lot of solutions but nothing work and still can’t understand what the problem is

I’m sorry to hear that, let me share this post with the staff team.

the problem start in course 1 from first optional lab in week 3

@rmwkwok Hi Raymond! Could you help to check on this problem? I don’t have access to the MLS repository so I can’t file a ticket.
Thank you,
Kezhen

Hi, @ahmedelgohry02 the notebook uses custom widgets that is built in the utils files that comes with notebook.

I had this issue before but, when I restart the notebook and did not use any of the magic commands like %matplotlib inline or %matplotlib notebook everything works fine.

try doing so, and see if it works for you.

2 Likes

Thanks Moaz .
this works just fine to illustrate the plots ,i hope there’s a way to use the widgets for interactivity .
thanks alot for your help again .

1 Like

@ahmedelgohry02
very glad to hear it works for you.

1 Like