From: ellson Date: Fri, 4 Aug 2006 23:52:54 +0000 (+0000) Subject: add Q40 - what is the coordinate transformation between graph bb and .png images? X-Git-Tag: LAST_LIBGRAPH~32^2~6001 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7fd47dcb80be291cd2ae8403e4365d993cfac05a;p=graphviz add Q40 - what is the coordinate transformation between graph bb and .png images? --- diff --git a/doc/FAQ.html b/doc/FAQ.html index 32b5f696f..a59deb40f 100644 --- a/doc/FAQ.html +++ b/doc/FAQ.html @@ -965,7 +965,7 @@ Phil Colbourne at the RailCorp of New South Wales for this advice). For help with embedding SVG in HTML pages, see here.

-There are several goodstandalone viewers and editors for SVG. +There are several good standalone viewers and editors for SVG. We like inkscape. evince is the standard Gnome document viewer that handles SVG, at least @@ -988,5 +988,40 @@ Is this a real problem? No, this is a false positive reported by various security software. See http://www.pcreview.co.uk/forums/thread-1689630.php or http://spywareblog.com/index.php/2004/11/24/is_libexpat_dll_spyware. +

+ +Q. What is the coordinate transformation between the graph bb and a .png image? + +

    +
  1. +The bb is expanded by 4 graph-units in all directions (pad) to allow for finite line widths. +
  2. +Then it is zoomed and/or rotated according to -Gviewport, -Gsize, -Glandscape, -Gorientation options. +At the default scaling of 1:1, one graph unit = 1 point (1/72 inch). +
  3. +Then it is paginated, if requested by -Gpage and if the output format supports it. Not the -Tpng renderer, yet. +
  4. +Then a margin is added, -Gmargin, in absolute units (inches). +The top/bottom margin can be set independently of the left/right margin. +
  5. +Then it is converted to device units, according to -Gdpi, +or a dpi value that is given by the output device, +or a default that is provided by each render. +There are separate dpi values for x an y to allow for non-square pixels. +Some renderers invert the Y axis and need an offset to place the +origin in the top left corner. +The default dpi for -Tpng is 96dpi (approximating the resolution +of most computer monitors) so this is where the scaling by 96/72 (4/3) +comes from. +
+

+At the renderer api, plugins have a choice of coordinate representation: +