diff options
Diffstat (limited to 'cairoplot/handlers/vector.py')
-rwxr-xr-x | cairoplot/handlers/vector.py | 17 |
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() + |