Hello and welcome,
Just in case it is helpful, have you checked out the blog post about plotting in Anvil?
It includes a section about matplotlib including clone-able examples.
If you are getting a matplotlib object from somewhere else and bringing that into your app, I would assume that Anvil would be able handle it as it would normally handle that type of object.
Perhaps that blog post can help you to make progress. There is also more information about matplotlib on the forum and in the documentation.
I hope this is helpful in some way.