Building svg file using svgwrite-1.1.9 using polyline entities.
How can I prevent flipped output? It seems the coordinates are messed up - vertical (y) is flipped.
Here's the code I'm using to generate the polyline:
# generate svg element
line = dwg.add(dwg.polyline(
pairs,
stroke='black', fill='blue'))
Pairs is a list of tuples in cartesian coordinates (X Y pairs):
[(2228.427, 1643.919), (2419.889, 1643.919), (2419.889, 1814.927), (2431.918, 1985.935), (2216.397, 1985.935), (2228.427, 1814.927), (2228.427, 1643.919)]
I'm using InkScape to visualize the svg output, and an in-house editor to visualize an alternate data stream; the in-house version is the correct version. I'm missing one entity.
The right entity block is rotated (in source), the left one is not (but is flipped). You can see in the svg that the entire right block is also flipped vertically, so it's above where it should be.
I haven't set any user viewport/coordinates in the SVG.
I'm pretty sure XY are the same (SVG, other).
Difference between SVG and data coordinate systems is the correct answer, I can't flag Martineau as correct (not enough rep?)
, but this lets me post an updated graphic.