Re: Gnuplot generates invalid SVG?
- From: merritt@xxxxxxxxxxxxxxxxxxxxxxxxxxx
- Date: Tue, 29 Jul 2008 14:03:22 -0700 (PDT)
In article <690b2765-9c8f-48b9-bcdd-c892e545fb16@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
<googoff@xxxxxxxxxxx> wrote:
On Jul 28, 11:10=A0pm, merr...@xxxxxxxxxxxxxxxxxxxxxxxxxxx wrote:
In article <6f6q2cFa4fi...@xxxxxxxxxxxxxxxxxx>,.edu>:
Michael Schmarck =A0<michael.schma...@xxxxxxxxxxxx> wrote:
=B7 merr...@xxxxxxxxxxxxxxxxxxxxxxxxxxx <merr...@xxxxxxxxxxxxxxxxxxxxxxx=
Possibly you copied or saved the file before gnuplot was finished
writing it.
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>
line.
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
Hi Ethan,
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
data.
Should replot implicitly close and reopen ? Is there a circumstance
where replot would intentionally superimpose, and how would this
compare to other formats?
Sure:
set multiplot layout 2,2 title "Gradually more complex graph"
plot 'foo'
replot 'baz'
replot 'third'
replot 'allatonce'
unset multiplot
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
.
- Follow-Ups:
- Re: Gnuplot generates invalid SVG?
- From: Dan Anderson
- Re: Gnuplot generates invalid SVG?
- From: googoff
- Re: Gnuplot generates invalid SVG?
- References:
- Gnuplot generates invalid SVG?
- From: Michael Schmarck
- Re: Gnuplot generates invalid SVG?
- From: Michael Schmarck
- Re: Gnuplot generates invalid SVG?
- From: merritt
- Re: Gnuplot generates invalid SVG?
- From: googoff
- Gnuplot generates invalid SVG?
- Prev by Date: Re: Gnuplot generates invalid SVG?
- Next by Date: Re: maxcolors in wxt vs x11
- Previous by thread: Re: Gnuplot generates invalid SVG?
- Next by thread: Re: Gnuplot generates invalid SVG?
- Index(es):
Relevant Pages
|