|
From: Arun P. <ape...@lb...> - 2012-04-27 20:48:43
|
Hi
I just ran into the following error when trying to open a svg file
created by gnuplot:
"test.svg:898: parser error : Input is not proper UTF-8, indicate encoding !
Bytes: 0x80 0x22 0x20 0x3E"
and I can't open the svg (tried inkscape and eog).
Here is the script that produced the svg:
--------------
reset
N=30
set term svg
set out "test.svg"
set size N,N
set multiplot
set size 1,1
do for [i=1:N] {
do for [j=i:N] {
set title "x: ".i." y: ".j
set origin ((i-1)),((j-1))
plot sin(i*j*x)
}
}
unset multiplot
set out
--------------
The script works OK for small N, e.g. N=3.
Not sure if this is a problem with gnuplot or my lib that reads svg...
can someone reproduce this?
I'm running the latest gnuplot cvs version (updated a few hours ago) on
openSUSE Tumbleweed. Compiled cvs using "./prepare; configure; make".
As a side question: in the above script how do I get to size the output
of the svg to the N,N size? Or if I use set size 1,1 outside multiplot
and set size 1.0/N,1.0/N inside multiplot, how to I get gnuplot to scale
the whole plot including fonts, tics, etc.
thanks
Arun
|
|
From: <pl...@pi...> - 2012-04-27 22:41:03
|
On 04/27/12 22:48, Arun Persaud wrote:
> Hi
>
> I just ran into the following error when trying to open a svg file
> created by gnuplot:
>
> "test.svg:898: parser error : Input is not proper UTF-8, indicate encoding !
> Bytes: 0x80 0x22 0x20 0x3E"
>
> and I can't open the svg (tried inkscape and eog).
>
> Here is the script that produced the svg:
>
> --------------
> reset
> N=30
>
> set term svg
> set out "test.svg"
>
> set size N,N
>
> set multiplot
>
> set size 1,1
>
> do for [i=1:N] {
> do for [j=i:N] {
>
> set title "x: ".i." y: ".j
> set origin ((i-1)),((j-1))
>
> plot sin(i*j*x)
> }
> }
>
> unset multiplot
> set out
> --------------
>
> The script works OK for small N, e.g. N=3.
>
> Not sure if this is a problem with gnuplot or my lib that reads svg...
> can someone reproduce this?
>
> I'm running the latest gnuplot cvs version (updated a few hours ago) on
> openSUSE Tumbleweed. Compiled cvs using "./prepare; configure; make".
>
> As a side question: in the above script how do I get to size the output
> of the svg to the N,N size? Or if I use set size 1,1 outside multiplot
> and set size 1.0/N,1.0/N inside multiplot, how to I get gnuplot to scale
> the whole plot including fonts, tics, etc.
>
> thanks
>
> Arun
>
> --------------------------------------
confirmed, I ran your script and this is what firefox reported when
opening it.
XML Parsing Error: not well-formed
Location: file:///back/coredata/test.svg
Line Number 898, Column 23: <g id="gnuplot_plot_1\uffff"
><title>gnuplot_plot_1\uffff</title>
HTH
|
|
From: Ethan A M. <sf...@us...> - 2012-04-27 22:49:07
|
On Friday, April 27, 2012 01:48:32 pm Arun Persaud wrote:
> Hi
>
> I just ran into the following error when trying to open a svg file
> created by gnuplot:
>
> "test.svg:898: parser error : Input is not proper UTF-8, indicate encoding !
> Bytes: 0x80 0x22 0x20 0x3E"
You have indeed found a real bug, which I have just now fixed in the CVS
source code. The subplots in a multiplot are labeled internally as 'a'-'z'.
The bug was an incorrect check to prevent letters beyond 'z' from being
generated. So it triggered whenever the number of subplots exceeded 30.
However, your script will not work as it is even after the bug fix.
See comments below.
> --------------
> reset
> N=30
>
> set term svg
> set out "test.svg"
>
> set size N,N
Don't do this. "set size" should never use values greater than 1.
> set multiplot
>
> set size 1,1
>
> do for [i=1:N] {
> do for [j=i:N] {
>
> set title "x: ".i." y: ".j
> set origin ((i-1)),((j-1))
>
> plot sin(i*j*x)
> }
> }
>
> unset multiplot
> set out
> --------------
I think the revised script below does what you want.
You don't necessarily have to make the nominal x and y size bigger,
but if you don't then cramming in 900 subplots may run into the precision
issue that Peter brought up yesterday - that the coordinates written to the
output file only use 1 decimal place.
========================
XSIZE = 2400 # The default size is 600 x 480
YSIZE = 1800 # so this is roughly 4 times bigger
SCALE = 600./XSIZE
N = 30
set term svg size 2400,1800 fsize (10. * SCALE) lw (1. * SCALE)
set out "newversion.svg"
set multiplot layout N,N
do for [i=1:N] {
do for [j=i:N] {
set title "x: ".i." y: ".j
plot sin(i*j*x)
}
}
unset multiplot
=======================
> The script works OK for small N, e.g. N=3.
>
> Not sure if this is a problem with gnuplot or my lib that reads svg...
> can someone reproduce this?
>
> I'm running the latest gnuplot cvs version (updated a few hours ago) on
> openSUSE Tumbleweed. Compiled cvs using "./prepare; configure; make".
>
> As a side question: in the above script how do I get to size the output
> of the svg to the N,N size? Or if I use set size 1,1 outside multiplot
> and set size 1.0/N,1.0/N inside multiplot, how to I get gnuplot to scale
> the whole plot including fonts, tics, etc.
The revised script above shows how you can apply explicit scaling.
The CVS version has partial support for more generic scaling commands
but these are not yet implemented for the svg terminal.
Ethan
>
> thanks
>
> Arun
|
|
From: Arun P. <ape...@lb...> - 2012-04-30 17:57:33
|
Hi >> I just ran into the following error when trying to open a svg file >> created by gnuplot: >> >> "test.svg:898: parser error : Input is not proper UTF-8, indicate encoding ! >> Bytes: 0x80 0x22 0x20 0x3E" > > You have indeed found a real bug, which I have just now fixed in the CVS > source code. The subplots in a multiplot are labeled internally as 'a'-'z'. > The bug was an incorrect check to prevent letters beyond 'z' from being > generated. So it triggered whenever the number of subplots exceeded 30. Thanks for the bugfix... tested it and everything works great! > [...] > set term svg size 2400,1800 fsize (10. * SCALE) lw (1. * SCALE) also thanks for helping with the script... fsize and lw in "set term" was what I was missing. cheers Arun |