I like to save my plots in a vector format, e.g. pdf or svg.
By default, matplotlib saves plotted curves as points connected by straight lines. In SVG language, using the m
<path>
command.
Is there a way to save paths using Bézier Curves? In SVG, that would be using c
commands.
I found many suggestions to use cubic interpolation, e.g. with scikit, to make the curve look smooth by increasing the number of points. That's not what I want to do. I have enough points in my plots. I just want them to appear perfectly smooth in a vector graphics viewer, which would be the case if the paths were written with smooth nodes, as shown in the screenshot from Inkscape. The top curve has smooth nodes (I used the "Make selected nodes auto-smooth" button in Inkscape) and the bottom one doesn't.
If that isn't possible directly with matplotlib, is there a program that can smooth all the curves in a PDF or SVG file?