Re: Gnuplot generates invalid SVG?
- From: googoff@xxxxxxxxxxx
- Date: Wed, 30 Jul 2008 00:48:15 -0700 (PDT)
On Jul 29, 11:03 pm, merr...@xxxxxxxxxxxxxxxxxxxxxxxxxxx wrote:
In article <690b2765-9c8f-48b9-bcdd-c892e545f...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
On Jul 28, 11:10=A0pm, merr...@xxxxxxxxxxxxxxxxxxxxxxxxxxx wrote:
In article <6f6q2cFa4fi...@xxxxxxxxxxxxxxxxxx>,
Michael Schmarck =A0<michael.schma...@xxxxxxxxxxxx> wrote:
.edu>:=B7 merr...@xxxxxxxxxxxxxxxxxxxxxxxxxxx <merr...@xxxxxxxxxxxxxxxxxxxxxxx=
Possibly you copied or saved the file before gnuplot was finished
Well, sort of - I copied it, after I ran the commands I posted
in interactive mode. You'll notice, that there's no "quit" command
in the list of commands I posted.
After sending "quit" (or exit or ^d), the file has the </svg>
What's the command that makes gnuplot "close" the file? Is it
=A0 =A0 =A0 =A0set output
Either 'set output' or 'unset output' will force the current file
to be written and closed. =A0This is necessary because some output
types (e.g. postscript) allow multiple plots in the same file, so
gnuplot cannot close the output file until instructed that no more
plots are coming. =A0In the case of svg output, possibly it could be
smarter about writing the </svg> even in advance of closing the file.
Ethan A Merritt
could some thourght be given to this? It ties in with what I have seen
using replot in svg. Basically the whole file gets duped.
I don't really see how to make gnuplot smart enough to detect whether
you really want to add more to the existing plot or whether you want to
throw it away and create another one instead.
How do you suggest we could solve this basic problem?
IIRC what I was doing was defining a label (like a max x value or
something) as a result of plotting my data then using replot to get
the same graph with the label.
If this is done in png or similar bitmapped image there is repetition
of the plot command but the output just gets overwritten.
Not if you are streaming the output. You get a 2nd complete plot in
the output stream. This is, in fact, extremely useful. You can leave
the stream open on a viewer and see the successive plots as they are
created. If you tried to close the file each time, it would break the
connection to the viewer.
In the case of svg the file doubles in size and I get two versions of
the label superimposed with different strings, dependant on the input
Should replot implicitly close and reopen ? Is there a circumstance
where replot would intentionally superimpose, and how would this
compare to other formats?
set multiplot layout 2,2 title "Gradually more complex graph"
That will generate four non-overlapping graphs on the output page.
They will respectively contain 1, 2, 3, or 4 separate curves.
I wouldn't do it that way, myself, but some people do use replot for
that kind of thing.
Since all axes and labels are determined before plot it seems like
replot should close and reopen , in which case the anticipated </svg>
could be sent at the end of plot.
Sorry, I don't follow you here. The labels are known, yes, but the
axes are not detemined until the data is read in and evaluated.
Anyhow, what how does this relate to the issue of whether the previous
plot is to be discarded or saved?
At first sight this would seem to give output more consistant with
other terminal types and like you say, smarter svg closing.
Can you see a circumstance where this would not give correct output?
The obvious case is when you really do want more than one graph
on the same page. How would you accomplish that if the file is closed
automatically after the first one?
I don't say it's impossible to get this right, but so far I don't
see an obvious way to decide whether or not to close and reopen the file.
Ethan A Merritt
so it seems there are two circumstances that need to be accounted
for , multiplot and streaming.
multiplot would seem simple, if in multiplot we don't close the svg
tag until unset multiplot , this effectively reduces that case to the
same question as we have for single plots. Using replot without
multiplot should probably replace the output rather than superimpose
What I meant about labels and axes being predetermined was badly
expressed, What I should have said was that these elements cannot be
changes after plot so ( with the exception of multiplot ) it would be
safe to close the svg tag.
I am not familiar with streaming because I don't use it but I see what
In fact I think this underlines the inconsistancy between svg output
and bitmap types.
Maybe we need to close the svg tag but not close the output file, that
seems to be a different operation which, as you said, would break
streaming. How would svg readers deal with two sets of tags?
<svg></svg><svg></svg> Is this defined in the standard?
If this was streamed to an svg viewer would this be similar to
There seems to be a fault in including two different graphs , with
almost certainly conflicting elements, in the same svg element.
It would seem desirable to find a method that produces comparable
output on both svg and bitmapped terminals.
- Re: Gnuplot generates invalid SVG?
- From: Ethan Merritt
- Re: Gnuplot generates invalid SVG?
- Prev by Date: Re: Trouble parsing CSV file
- Next by Date: Re: Gnuplot generates invalid SVG?
- Previous by thread: Re: Gnuplot generates invalid SVG?
- Next by thread: Re: Gnuplot generates invalid SVG?