bugGNU Octave - Bugs: bug #34146, svg output does not scale

 
 

bug #34146: svg output does not scale

Submitted by:  None
Submitted on:  Sat 27 Aug 2011 07:54:41 AM UTC  
 
Category: Plotting with gnuplotSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: Works For MeAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 3.4.0
Operating System: GNU/Linux

Discussion locked!

 

(Jump to the original submission Jump to the original submission)

Wed 31 Aug 2011 06:48:43 PM UTC, comment #9:

I have confirmed that gnuplot has changed the way SVG is output. The code snippet below is from their developer's cvs.

The current sources should produce an unscaled version by default. Ironically, the manual for the 4.4 series indicates that unscaled is the default, but gnuplot produces a scalable version, none the less.

In any event, the sources can be modified to ensure the output is scalable for gnuplot.

As we'd like the OpenGL output to be consistent, I'll check with the glps developers to see what can be done there.

Ben Abbott <bpabbott>
Project Member
Wed 31 Aug 2011 04:22:19 PM UTC, comment #8:

If you are convinced there is a bug with gnuplot svg output, I suggest you report the bug to gnuplot.

Ben Abbott <bpabbott>
Project Member
Wed 31 Aug 2011 04:13:54 PM UTC, comment #7:

I did check your attachment out and it DOES NOT scale on the viewers I indicated. You have not replied to my question as to what viewer(s) you had tested on, so I'll have to guess from the mac.com addresses that you only used Safari. I reiterate your need to do further testing.

My gnuplot does not produce h,w when used via octave THAT is the bug I reported. Using gnuplot directly does . If I don't supply those parameters it uses a default and put THAT value in the output:(and it's output does scale)

gnuplot> set terminal svg
Terminal type set to 'svg'
Options are 'size 600,480 fixed fname 'Arial' fsize 12 butt solid '
gnuplot> set output 'svg-size-test.svg'

This produces a file starting as follows.

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
width="600" height="480"
viewBox="0 0 600 480"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"

>


<desc>Produced by GNUPLOT 4.5 patchlevel 0 </desc>

I hope that helps you confirm the bug.

Anonymous
Wed 31 Aug 2011 04:11:43 PM UTC, comment #6:

Octave is not a commercial program--it is maintained by solely by volunteers. We are not your personal developers unless you agree to pay us. We have confirmed that it works on two different operating systems (Mac OS and Linux) and two different versions of gnuplot (4.4.3 and 4.2.6) and I have tried it on two different versions of Octave (3.4.0 and 3.4.2). I would suggest you try a true svg editor, such as Inkscape, rather than a browser to truly determine whether the generated svg is scalable.

Rik <rik5>
Project Administrator
Wed 31 Aug 2011 01:58:28 PM UTC, comment #5:

Its been a while since I was familar with SVG file format, but I'm rather confident that the line below means the graphic is scalable.

<svg viewBox="0 0 576 452">

But this one is not.

<svg width="576px" height="452px" viewBox="0 0 576 452">

To be clear the svg produced by my gnuplot does not include the width/height attributes.

In my prior comment, I indicated that I'd attached an example produced using the gnuplot backend. Please take a look.

I'm running gnuplot 4.4 patchlevel 3. What version of gnuplot are you running?

Ben Abbott <bpabbott>
Project Member
Wed 31 Aug 2011 01:13:24 PM UTC, comment #4:

checkout what viewBox means ;)

you need h,w as well.

Anonymous
Wed 31 Aug 2011 12:39:17 PM UTC, comment #3:

What are use using to view this "works for me" ?

I have tested with firefox and opera. The latter has a note in the status bar that shows the "zoom" is increasing is I supposedly zoom in but the image stays the same display size.

I have indicated there is a problem , if it "works for you" then maybe you need to do more thorough testing.

Anonymous
Wed 31 Aug 2011 05:10:17 AM UTC, comment #2:

I plotted sombrero() and scaling works for me as well.

Rik <rik5>
Project Administrator
Wed 31 Aug 2011 01:48:43 AM UTC, comment #1:

I did a simple test using the developer's sources.

I've attached the result. It scales for me.

(file #23911)

Ben Abbott <bpabbott>
Project Member
Sat 27 Aug 2011 07:54:41 AM UTC, original submission:

using print() with -dsvg produces a non-scalable svg.

since the "s" in svg stands for "scalable" it rather seems to defeat the main purpose of this format to produce non scalable output.

looking at the first few lines shows :

<svg
viewBox="0 0 576 432"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"

Looking at other svg files created with gnuplot I see the first line contains height and width:

<svg width="600" height="480" viewBox="0 0 600 480"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">

Since having a non-scalable "scalable" graphic is probably not what is most useful I assume this is an error.

Anonymous

 

Attached Files
file #23911:  gnuplot.svg added by bpabbott (633KiB - image/svg+xml)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by bpabbott (Updated the item)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 10 Jan 2012 01:58:48 AM UTCjordighDependencies-=>bugs #35270 is dependent
    Wed 31 Aug 2011 04:22:58 PM UTCrik5Discussion LockUnlocked=>Locked
    Wed 31 Aug 2011 04:11:43 PM UTCrik5Open/ClosedOpen=>Closed
    Wed 31 Aug 2011 01:48:43 AM UTCbpabbottAttached File-=>Added gnuplot.svg, #23911
      StatusNone=>Works For Me

    Back to the top


    Powered by Savane 3.1-cleanup1