Plot implements the Plot method of the plot.Plotter interface.
(c draw.Canvas, p *plot.Plot)
| 53 | |
| 54 | // Plot implements the Plot method of the plot.Plotter interface. |
| 55 | func (img *Image) Plot(c draw.Canvas, p *plot.Plot) { |
| 56 | trX, trY := p.Transforms(&c) |
| 57 | xmin := trX(img.xmin) |
| 58 | ymin := trY(img.ymin) |
| 59 | xmax := trX(img.xmax) |
| 60 | ymax := trY(img.ymax) |
| 61 | rect := vg.Rectangle{ |
| 62 | Min: vg.Point{X: xmin, Y: ymin}, |
| 63 | Max: vg.Point{X: xmax, Y: ymax}, |
| 64 | } |
| 65 | c.DrawImage(rect, img.transformFor(p)) |
| 66 | } |
| 67 | |
| 68 | // DataRange implements the DataRange method |
| 69 | // of the plot.DataRanger interface. |
no test coverage detected