I use matplotlib/seaborn/plotly-express to generate the figure and write a png. That way I can easily refine the figure once it goes from "trivial" to "complex": customize dpi, axis titles and ticks, latex in labels, annotating the line plots, etc. I'm picky about such details so often what should be easy becomes hard.
- and as Obsidian plugin: https://github.com/alincoop/obsidian-tinychart