MCPcopy Create free account
hub / github.com/cogentcore/core / configPlot

Method configPlot

plot/plotcore/ploteditor.go:338–357  ·  view source on GitHub ↗

configPlot configures the given plot based on the plot options.

(plt *plot.Plot)

Source from the content-addressed store, hash-verified

336
337// configPlot configures the given plot based on the plot options.
338func (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
360func (pl *PlotEditor) plotXAxis(plt *plot.Plot, ixvw *table.IndexView) (xi int, xview *table.IndexView, err error) {

Callers 2

genPlotXYMethod · 0.95
genPlotBarMethod · 0.95

Calls 4

xLabelMethod · 0.95
yLabelMethod · 0.95
MinFunction · 0.92
MaxFunction · 0.92

Tested by

no test coverage detected