SetPlot sets the plot to given Plot, and calls UpdatePlot to ensure it is drawn at the current size of this widget
(pl *plot.Plot)
| 39 | // SetPlot sets the plot to given Plot, and calls UpdatePlot to ensure it is |
| 40 | // drawn at the current size of this widget |
| 41 | func (pt *Plot) SetPlot(pl *plot.Plot) { |
| 42 | if pl != nil && pt.Plot != nil && pt.Plot.Pixels != nil { |
| 43 | pl.SetPixels(pt.Plot.Pixels) // re-use the image! |
| 44 | } |
| 45 | pt.Plot = pl |
| 46 | pt.updatePlot() |
| 47 | } |
| 48 | |
| 49 | // updatePlot draws the current plot at the size of the current widget, |
| 50 | // and triggers a Render so the widget will be rendered. |
no test coverage detected