Menu

#1779 Extra "</g>" in SVG output, when plotting two plots

None
closed-duplicate
nobody
svg (10)
2016-04-18
2016-04-17
No

Version 5.0.3 under Linux, was also able to reproduce it in 4.6.4 under Linux

This script (I tried to make it as simple as possible) produces bad XML (output terminal is set to SVG):

#!/usr/local/bin/gnuplot

output_file = "test.svg"

set terminal svg

set output output_file

plot [0:10] [0:2] 1
plot [0:10] [0:2] 1.5

Then in terminal:

$ xmllint test.svg 
test.svg:232: parser error : Opening and ending tag mismatch: svg line 4 and g
</g>
    ^
test.svg:233: parser error : Extra content at the end of the document
</svg>
^

Removing the second "plot" command fixes the problem.

The script is also attached for your convenience.

Thank you.

1 Attachments

Discussion

  • Ethan Merritt

    Ethan Merritt - 2016-04-18
    • status: open --> closed-duplicate
    • Group: -->
    • Priority: -->
     
  • Ethan Merritt

    Ethan Merritt - 2016-04-18

    Duplicate report: See tracker items #1298, #1397

    Short answer: Gnuplot output is normally one plot per page. You cannot put two separate pages into a single svg output file. You can, however, use "set multiplot" to produce a single page that just happens to hold two plots.

     

Log in to post a comment.