I have been shopping around for a plotting library that can be used with Joplin and finally found it.
This plugin will help plotting mathematical function such as $y = x^2$ right in joplin.
I have been developing this in a hurry so not sure if it has any bug but as the implementation is quite straightforward it's probably find. Please find the usage instruction in github
The release version should be available on the plugin repository soon.