Menu

#2250 plotting to SVG on macOS results in broken XML

None
closed-not-a-bug
nobody
2020-07-21
2020-04-19
No

Using 5.2.8 on macOS (installed from HomeBrew). Even simple graphs generated to SVG file produce invalid XML.

It seems that somehow the initial part is duplicated and then the svg element closed.

3 Attachments

Discussion

  • Ethan Merritt

    Ethan Merritt - 2020-04-19

    The problem is the clear command in your script. It acts like a hypothetical command plot blank page. Then the script issues a reset and another plot command. The result is a file containing two separate svg documents, the first one blank and the second one from the plot command. But svg files are only allowed to contain a single document, hence the error you see.

    Solution (1) Do not issue a clear command.

    Solution (2) If you must issue a clear for some reason (why would this be?), wrap the whole series of commands in set multiplot; ... unset multiplot;

    The clear command exists so that you can erase the current plot window in an interactive session or erase a portion of the total canvas being created inside set multiplot. For svg that first use makes no sense, so it should only be used inside a multiplot.

    Possibly gnuplot should issue an error message when it sees a clear command in a context that makes no sense, but that may be difficult to determine in the general case.

     
  • Ethan Merritt

    Ethan Merritt - 2020-04-19
    • status: open --> open-not-a-bug
    • Group: -->
    • Priority: -->
     
  • Ethan Merritt

    Ethan Merritt - 2020-07-21
    • Status: open-not-a-bug --> closed-not-a-bug
     

Log in to post a comment.

MongoDB Logo MongoDB