configPlot configures the given plot based on the plot options.
(plt *plot.Plot)
| 336 | |
| 337 | // configPlot configures the given plot based on the plot options. |
| 338 | func (pl *PlotEditor) configPlot(plt *plot.Plot) { |
| 339 | plt.Title.Text = pl.Options.Title |
| 340 | plt.X.Label.Text = pl.xLabel() |
| 341 | plt.Y.Label.Text = pl.yLabel() |
| 342 | |
| 343 | for _, cp := range pl.Columns { // key that this comes at the end, to actually stick |
| 344 | if !cp.On || cp.IsString { |
| 345 | continue |
| 346 | } |
| 347 | if cp.Range.FixMin { |
| 348 | plt.Y.Min = math32.Min(plt.Y.Min, float32(cp.Range.Min)) |
| 349 | } |
| 350 | if cp.Range.FixMax { |
| 351 | plt.Y.Max = math32.Max(plt.Y.Max, float32(cp.Range.Max)) |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | plt.Legend.Position = pl.Options.LegendPosition |
| 356 | plt.X.TickText.Style.Rotation = float32(pl.Options.XAxisRotation) |
| 357 | } |
| 358 | |
| 359 | // plotXAxis processes the XAxis and returns its index |
| 360 | func (pl *PlotEditor) plotXAxis(plt *plot.Plot, ixvw *table.IndexView) (xi int, xview *table.IndexView, err error) { |