Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/cairoplot/handlers/vector.py
diff options
context:
space:
mode:
Diffstat (limited to 'cairoplot/handlers/vector.py')
-rwxr-xr-xcairoplot/handlers/vector.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/cairoplot/handlers/vector.py b/cairoplot/handlers/vector.py
new file mode 100755
index 0000000..0c4d4bc
--- /dev/null
+++ b/cairoplot/handlers/vector.py
@@ -0,0 +1,17 @@
+
+import cairo
+from .fixedsize import FixedSizeHandler as _FixedSizeHandler
+
+class VectorHandler(_FixedSizeHandler):
+ """Handler to create plots that output to vector files."""
+
+ def __init__(self, surface, *args, **kwargs):
+ """Create Handler for arbitrary surfaces."""
+ _FixedSizeHandler.__init__(self, *args, **kwargs)
+ self.surface = surface
+
+ def commit(self, plot):
+ """Writes plot to file."""
+ _FixedSizeHandler.commit(self, plot)
+ self.surface.finish()
+