#1298 replot into svg writes one extra </g> tag

5.0
closed-wont-fix
nobody
None
5
2014-05-27
2013-11-07
No

set terminal svg
set output 'test.svg'
plot x
replot x

This script writes a corrupted svg file, which contains one extra tag without opening . Everything seems OK without "replot".
Gnuplot 4.6.4, Fedora 19, 64-bit Intel.

Discussion

  • Sorry for not sanitizing the tags. It is </g> without matching <g>.

     
  • Ethan Merritt
    Ethan Merritt
    2013-11-07

    Confirmed.
    The breakage seems to have occurred between 4.4.4 and 4.6.0.

    On the other hand, this sequence of commands makes little sense for svg output. Unlike page-oriented formats (PostScript, PDF) or interactive displays that allow sequential inspection of plots (x11, wxt, qt), svg documents are not intended to hold more than one full-page display element. Even if the number of \<g>/\</g> pairings were correct, the 2 plots would lie on top of each other. The normal sequence would be to either reopen the output svg file (new "set output" command) before the "replot", or wrap both the 1st and 2nd plots in a multiplot sequence:
    set multiplot layout 2,1
    plot x
    replot
    unset multiplot

    So while I agree than producing a corrupt document is not helpful, fixing that will only reveal an underlying problem in the command sequence that produced it.

     
    Last edit: Ethan Merritt 2013-11-07
  • Ethan Merritt
    Ethan Merritt
    2013-11-07

     
  • Thanks.

     
  • Hari Dara
    Hari Dara
    2014-05-07

    I just opened and closed (as duplicate) a bug for this same issue. Just posting the link here in case any information from the other bug is going to be useful for fixing the issue: https://sourceforge.net/p/gnuplot/bugs/1397/

     
  • Ethan Merritt
    Ethan Merritt
    2014-05-27

    • status: open --> closed-wont-fix