Skip to content

plot: add WriterTo method to Plot

Sebastien Binet requested to merge writerto into master

Created by: kortschak

This is a first stab at implementing a generalised plot writing method as suggested here.

I'm not completely happy with it for a couple of reasons: 1. we lose the title in eps (I'm less concerned about this) and 2. it's not extensible.

Addressing the second point. If we have a map[string]func(w, h vg.Length) interface { vg.CanvasSizer; io.WriterTo } that can be registered to, then this problem goes away. This map must be in vg, and referenced from the WriterTo method. Then each vg implementation that can make a WriterTo will register in an init.

Merge request reports

Loading