SVG and pdf


This may be a pdf issue or an SVG issue and have nothing to do with matplotlib. If so, sorry...

Whenever I produce a figure with matplotlib and 'crop it' using the axis command the svg comes out fine. However, when I save this svg to pdf using inkscape's 'cairo' backend the part of the data that was 'cropped' becomes visible in the pdf. e.g. if I had plotted data from x = -2 to +10, and then I set the axes to only show the data from +3 to +6, the svg comes out fine, but the pdf shows the rest of the graph leaking out from the axes.

I currently have to manually crop my data to prevent this.