func (a *SetLineWidth) Call() string {
	return fmt.Sprintf("%sSetLineWidth(%v)", a.l, a.Width)
}
Call returns the method call that generated the action.
package recorder  
import (
	"bytes"
	"encoding/base64"
	"fmt"
	"image"
	"image/color"
	"image/png"
	"runtime"
	"gonum.org/v1/plot/font"
	"gonum.org/v1/plot/font/liberation"
	"gonum.org/v1/plot/vg"
)
var _ vg.Canvas = (*Canvas)(nil)
type Canvas struct {
	Actions []Action
	KeepCaller bool
	c vg.Canvas
	fonts map[fontID]font.Face
	cache *font.Cache
}
type fontID struct {
	name string
	size vg.Length
}
type Action interface {
	Call() string
	ApplyTo(vg.Canvas)
	callerLocation() *callerLocation
}
type callerLocation struct {
	haveCaller bool
	file       string
	line       int
}
func (l *callerLocation) set() {
	_, l.file, l.line, l.haveCaller = runtime.Caller(3)
}
func (l callerLocation) String() string {
	if !l.haveCaller {
		return ""
	}
	return fmt.Sprintf("%s:%d ", l.file, l.line)
}
func (c *Canvas) Reset() {
	c.Actions = c.Actions[:0]
}
func (c *Canvas) ReplayOn(dst vg.Canvas) error {
	if c.fonts == nil {
		c.fonts = make(map[fontID]font.Face)
	}
	if c.cache == nil {
		c.cache = font.NewCache(liberation.Collection())
	}
	for _, a := range c.Actions {
		fa, ok := a.(*FillString)
		if !ok {
			continue
		}
		f := fontID{name: fa.Font.Name(), size: fa.Size}
		if _, exists := c.fonts[f]; !exists {
			if !c.cache.Has(fa.Font) {
				return fmt.Errorf("Unknown font: %s.", fa.Font.Typeface)
			}
			face := c.cache.Lookup(
				fa.Font,
				fa.Size,
			)
			c.fonts[f] = face
		}
		fa.fonts = c.fonts
	}
	for _, a := range c.Actions {
		a.ApplyTo(dst)
	}
	return nil
}
func (c *Canvas) append(a Action) {
	if c.c != nil {
		a.ApplyTo(c)
	}
	if c.KeepCaller {
		a.callerLocation().set()
	}
	c.Actions = append(c.Actions, a)
}
type SetLineWidth struct {
	Width vg.Length
	l callerLocation
}
func (c *Canvas) SetLineWidth(w vg.Length) {
	c.append(&SetLineWidth{Width: w})
}