Matplotlib on iMac M1 using Python 3.12.0 not working

I have used matplot lib successfully in past using Raspberry Pi. Want now to use on iMac M1 (still using OS Ventura latest version as Sonoma not yet installed). Anaconda apparently says matplotlib is installed but python programs cannot access it. Can anyone advise why?

Can you give more details on what you tried, and share exact error messages?