UpdateRange updates the axis range values based on current Plot values. This first resets the range so any fixed additional range values should be set after this point.
()
| 187 | // This first resets the range so any fixed additional range values should |
| 188 | // be set after this point. |
| 189 | func (pt *Plot) UpdateRange() { |
| 190 | pt.X.Min = math32.Inf(+1) |
| 191 | pt.X.Max = math32.Inf(-1) |
| 192 | pt.Y.Min = math32.Inf(+1) |
| 193 | pt.Y.Max = math32.Inf(-1) |
| 194 | for _, d := range pt.Plotters { |
| 195 | pt.UpdateRangeFromPlotter(d) |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | func (pt *Plot) UpdateRangeFromPlotter(d Plotter) { |
| 200 | if x, ok := d.(DataRanger); ok { |