From 56aae02821c13e080e138247e65615df8bf83586 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Wed, 25 Apr 2018 11:54:06 -0700 Subject: [PATCH] fix svg export failure when first line point is masked --- pyqtgraph/exporters/SVGExporter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyqtgraph/exporters/SVGExporter.py b/pyqtgraph/exporters/SVGExporter.py index 3e060e62..ae1ec91c 100644 --- a/pyqtgraph/exporters/SVGExporter.py +++ b/pyqtgraph/exporters/SVGExporter.py @@ -344,6 +344,10 @@ def correctCoordinates(node, defs, item): t = '' nc = fn.transformCoordinates(tr, np.array([[float(x),float(y)]]), transpose=True) newCoords += t+str(nc[0,0])+','+str(nc[0,1])+' ' + # If coords start with L instead of M, then the entire path will not be rendered. + # (This can happen if the first point had nan values in it--Qt will skip it on export) + if newCoords[0] != 'M': + newCoords = 'M' + newCoords[1:] ch.setAttribute('d', newCoords) elif ch.tagName == 'text': removeTransform = False