SVG plots

Michael suggested that I tried out SVG images instead of antialiasing PNG images for my graphs here.

Well, here goes:

PNG file:

SVG plot of time without spatial queries

SVG file:



Browser does not support SVG files!

28-46=-18

Tags: , ,

10 Responses to “SVG plots”

  1. Ryan Says:

    I don’t think those are actually svg files. I can’t open them with an svg editor.

    They seem to be pngs to me.

  2. Thomas Mailund Says:

    You know, I believe you are right.

    That is weird, ’cause I uploaded svg files, and the html source shows that the source is http://www.mailund.dk/wp-content/uploads/2009/01/no-geo.svg

    Well, that file seems to be a PNG :( Don’t know what went wrong.

    http://www.mailund.dk/wp-content/uploads/2009/01/geo.svg on the other hand is svg.

    I’ll have another look at it :)

  3. Thomas Mailund Says:

    Right, now there should be one PNG and one SVG file.

    Now why the embedded svg file is clipped on the right I don’t know… my html hacking days is far in the past, and I’m too rusty to figure this out right now :(

  4. Thomas Mailund Says:

    Grrr, this is crazy!

    If I embed the svg file from this page http://techrageo.us/2007/04/07/php-and-wordpress-svg-basics/ directly as it is on that page (but with a full URL, of course) it works as expected.

    If I embed my own figure the same way, Firefox asks for a plugin. With object tags around it, it displays the figure but completely ignores the dimensions.

    This sucks. *And* blows!

  5. Thomas Mailund Says:

    Okay, now it doesn’t work at all :(

    With object tags at least it displayed before, but now I just get a missing plugin image…

    Help, anyone?

  6. Mikaelhc Says:

    Hi,

    Looks very good. The text is better rendered than the old PNG’s. And it scales :-)

    To embed use the following (replace brackets):

    [object type="image/svg+xml" data="geo.svg"]
    Browser does not support SVG files!
    [/object]

  7. Thomas Mailund Says:

    Yeah! That works, thanks! I used “src” instead of “data” in my object tags, and that f*cked it up.

    Got that “src” from an example web page somewhere, but I cannot find it right now.

    Do you have any idea why the embed tag — that works for other files — didn’t work for mine?

  8. Mikaelhc Says:

    To control the size of the SVG from your tags, you use something like:

    [object type="image/svg+xml" data="geo.svg" width="200px" height="200px"]
    Browser does not support SVG files!
    [/object]

    This works for Firefox. In order for this to work under Safari as well, you will have to remove the hardcoded ‘height’ and ‘width’ attributes inside the SVG xml. Otherwise you will get clipping.

    Btw, the first image (the PNG file) refers to what actually is a PNG-file, but with a .SVG file extension. Weird.

  9. Mikaelhc Says:

    The ‘embed’ tag is not part of the HTML 4 or XHTML 1 standard. It is an obsolete and non-standard way of inserting objects. It will be part of HTML 5, though :-)

  10. Abhishek Tiwari Says:

    Just try Ctrl+ and see the difference between SVG image and its PNG counterpart

Leave a Reply