func drawPng(b *bytes.Buffer, p *plot.Plot, width, height float64) { w, h := vg.Inches(width), vg.Inches(height) c := vgimg.PngCanvas{Canvas: vgimg.New(w, h)} p.Draw(plot.MakeDrawArea(c)) c.WriteTo(b) }