Search
Ploticus >
Scripts >
ploticus can produce graphics in SVG format. SVG is a vector graphic format originated by
Adobe Systems
and defined in a
W3C spec
. SVGs look good because nice fonts are standard, and graphics scale with no degradation in
appearance. SVG can be viewed using Firefox 1.5+ and MSIE browsers, and can be imported into
tools such as Word, Powerpoint, etc.
There's also the
rsvg
utility for converting SVG files to PNG or other raster formats.
SVG files have names ending in .svg.
SVG files can also be compressed for smaller size; these files have names ending in .svgz.
Compression requires zlib and hence may not be available in all ploticus builds.
Generating SVG
To generate SVG, use the -svg or -svgz command line option (-svgz gives you
compressed svg results).
Output files will have an .svg or .svgz ending by default.
The -zlevel n option may be used to set the compression level to n
(0 - 9 where 9 is highest level of compression).
There are several settings / command line options particularly for use with SVG. See below.
Embedding SVG graphics within HTML
To display an SVG graphic within an HTML document, use an <object> tag like this:
<object data="myresult.svg" type="image/svg+xml" width=300 height=200 title="ploticus example">
</object>
An older method involving the <embed> tag is no longer recommended.
The embed tag was used like this:
<embed src="bars2.svg" name="SVGEmbed" width="500" height="616"
type="image/svg+xml" pluginspage="http://www.adobe.com/svg/viewer/install/">
Fonts
Default font is Helvetica. Postscript font names such as
Times-Roman and Courier may be used.
Font names containing embedded whitespace may be problematic with ploticus' SVG driver.
More info
Clickable maps
Clickmaps
are supported in browser environments.
Use -csmap command line option.
Here's an example script
and
svg result.
You can specify a target window (similarly to HTML <a target=...>)
using this syntax in your ploticus script: clickmapurl: [target=new]http://abc.com/...
(changed in 2.33)
Mouseover text bubbles / tooltips
Mouseover text bubbles
(tooltips), are supported for SVG when viewing in a browser.
There are two javascript-based methods (both suggested by Jamie Echlin) that can be used:
Method #1: (the default) uses javascript files (available
from the ploticus download page).
Produces SVGs that support mouseover independently without involving the containing HTML file.
There are some
proc settings attributes
that may be useful.
Here's an example pl script that uses this method.