Documentation
¶
Overview ¶
Package plotcore provides GUI Cogent Core widgets for viewing and editing plots.
Index ¶
- Constants
- Variables
- func MetaMapLower(meta map[string]string, key string) (string, bool)
- type ColumnParams
- type Plot
- func (pt *Plot) Init()
- func (t *Plot) New() tree.Node
- func (t *Plot) NodeType() *types.Type
- func (pt *Plot) Render()
- func (pt *Plot) SavePNG(filename core.Filename) error
- func (pt *Plot) SavePlot(filename core.Filename) error
- func (pt *Plot) SetPlot(pl *plot.Plot)
- func (t *Plot) SetScale(v float32) *Plot
- func (pt *Plot) SizeFinal()
- func (pt *Plot) UpdatePlot()
- func (pt *Plot) WidgetTooltip(pos image.Point) (string, image.Point)
- type PlotEditor
- func (pl *PlotEditor) ColParamsTry(colNm string) (*ColumnParams, error)
- func (pl *PlotEditor) ColumnParams(colNm string) *ColumnParams
- func (pl *PlotEditor) ColumnsFrame() *core.Frame
- func (pl *PlotEditor) ColumnsFromMetaMap(meta map[string]string)
- func (pl *PlotEditor) ColumnsListUpdate()
- func (pl *PlotEditor) ConfigPlot(plt *plot.Plot)
- func (pl *PlotEditor) CopyFieldsFrom(frm tree.Node)
- func (pl *PlotEditor) GenPlot()
- func (pl *PlotEditor) GenPlotBar()
- func (pl *PlotEditor) GenPlotXY()
- func (pl *PlotEditor) GoUpdatePlot()
- func (pl *PlotEditor) Init()
- func (pl *PlotEditor) MakeToolbar(p *tree.Plan)
- func (t *PlotEditor) New() tree.Node
- func (t *PlotEditor) NodeType() *types.Type
- func (pl *PlotEditor) OpenCSV(filename core.Filename, delim table.Delims)
- func (pl *PlotEditor) OpenFS(fsys fs.FS, filename core.Filename, delim table.Delims)
- func (pl *PlotEditor) PlotChild() *Plot
- func (pl *PlotEditor) PlotXAxis(plt *plot.Plot, ixvw *table.IndexView) (xi int, xview *table.IndexView, err error)
- func (pl *PlotEditor) SaveAll(fname core.Filename)
- func (pl *PlotEditor) SaveCSV(fname core.Filename, delim table.Delims)
- func (pl *PlotEditor) SavePNG(fname core.Filename)
- func (pl *PlotEditor) SaveSVG(fname core.Filename)
- func (pl *PlotEditor) SetAllColumns(on bool)
- func (pl *PlotEditor) SetColParams(colNm string, on bool, fixMin bool, min float32, fixMax bool, max float32) *ColumnParams
- func (pl *PlotEditor) SetColumnsByName(nameContains string, on bool)
- func (t *PlotEditor) SetConfigPlotFunc(v func()) *PlotEditor
- func (t *PlotEditor) SetDataFile(v core.Filename) *PlotEditor
- func (pl *PlotEditor) SetIndexView(tab *table.IndexView) *PlotEditor
- func (t *PlotEditor) SetParams(v PlotParams) *PlotEditor
- func (t *PlotEditor) SetSVGFile(v core.Filename) *PlotEditor
- func (pl *PlotEditor) SetTable(tab *table.Table) *PlotEditor
- func (pt *PlotEditor) SizeFinal()
- func (pl *PlotEditor) UpdatePlot()
- func (pl *PlotEditor) XLabel() string
- func (pl *PlotEditor) YLabel() string
- type PlotParams
- type PlotTypes
- func (i PlotTypes) Desc() string
- func (i PlotTypes) Int64() int64
- func (i PlotTypes) MarshalText() ([]byte, error)
- func (i *PlotTypes) SetInt64(in int64)
- func (i *PlotTypes) SetString(s string) error
- func (i PlotTypes) String() string
- func (i *PlotTypes) UnmarshalText(text []byte) error
- func (i PlotTypes) Values() []enums.Enum
- type TableXY
- func (txy *TableXY) FilterValues()
- func (txy *TableXY) Label(row int) string
- func (txy *TableXY) Len() int
- func (txy *TableXY) TRowValue(row int) float32
- func (txy *TableXY) TRowXValue(row int) float32
- func (txy *TableXY) Validate() error
- func (txy *TableXY) Value(row int) float32
- func (txy *TableXY) XValue(row int) float32
- func (txy *TableXY) XY(row int) (x, y float32)
- func (txy *TableXY) YError(row int) (float32, float32)
Constants ¶
const ( On bool = true Off = false FixMin = true FloatMin = false FixMax = true FloatMax = false )
use these for SetColParams args
const PlotColumnsHeaderN = 2
Variables ¶
var PlotEditorType = types.AddType(&types.Type{Name: "cogentcore.org/core/plot/plotcore.PlotEditor", IDName: "plot-editor", Doc: "PlotEditor is a widget that provides an interactive 2D plot\nof selected columns of tabular data, represented by a [table.IndexView] into\na [table.Table]. Other types of tabular data can be converted into this format.\nThe user can change various options for the plot and also modify the underlying data.", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Methods: []types.Method{{Name: "SaveSVG", Doc: "SaveSVG saves the plot to an svg -- first updates to ensure that plot is current", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Args: []string{"fname"}}, {Name: "SavePNG", Doc: "SavePNG saves the current plot to a png, capturing current render", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Args: []string{"fname"}}, {Name: "SaveCSV", Doc: "SaveCSV saves the Table data to a csv (comma-separated values) file with headers (any delim)", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Args: []string{"fname", "delim"}}, {Name: "SaveAll", Doc: "SaveAll saves the current plot to a png, svg, and the data to a tsv -- full save\nAny extension is removed and appropriate extensions are added", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Args: []string{"fname"}}, {Name: "OpenCSV", Doc: "OpenCSV opens the Table data from a csv (comma-separated values) file (or any delim)", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Args: []string{"filename", "delim"}}, {Name: "SetColumnsByName", Doc: "SetColumnsByName turns cols On or Off if their name contains given string", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Args: []string{"nameContains", "on"}}}, Embeds: []types.Field{{Name: "Frame"}}, Fields: []types.Field{{Name: "Table", Doc: "the table of data being plotted"}, {Name: "Params", Doc: "the overall plot parameters"}, {Name: "Columns", Doc: "the parameters for each column of the table"}, {Name: "Plot", Doc: "Plot is the plot object."}, {Name: "ConfigPlotFunc", Doc: "ConfigPlotFunc is a function to call to configure [PlotEditor.Plot], the plot.Plot that\nactually does the plotting. It is called after [Plot] is generated, and properties\nof [Plot] can be modified in it. Properties of [Plot] should not be modified outside\nof this function, as doing so will have no effect."}, {Name: "SVGFile", Doc: "current svg file"}, {Name: "DataFile", Doc: "current csv data file"}, {Name: "InPlot", Doc: "currently doing a plot"}}, Instance: &PlotEditor{}})
PlotEditorType is the types.Type for PlotEditor
var PlotType = types.AddType(&types.Type{Name: "cogentcore.org/core/plot/plotcore.Plot", IDName: "plot", Doc: "Plot is a widget that renders a [plot.Plot] object.\nIf it is not [states.ReadOnly], the user can pan and zoom the graph.\nSee [PlotEditor] for an interactive interface for selecting columns to view.", Methods: []types.Method{{Name: "SavePlot", Doc: "SaveSVG saves the current Plot to an SVG file", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Args: []string{"filename"}, Returns: []string{"error"}}, {Name: "SavePNG", Doc: "SavePNG saves the current rendered Plot image to an PNG image file.", Directives: []types.Directive{{Tool: "types", Directive: "add"}}, Args: []string{"filename"}, Returns: []string{"error"}}}, Embeds: []types.Field{{Name: "WidgetBase"}}, Fields: []types.Field{{Name: "Scale", Doc: "Scale multiplies the plot DPI value, to change the overall scale\nof the rendered plot. Larger numbers produce larger scaling.\nTypically use larger numbers when generating plots for inclusion in\ndocuments or other cases where the overall plot size will be small."}, {Name: "Plot", Doc: "Plot is the Plot to display in this widget"}}, Instance: &Plot{}})
PlotType is the types.Type for Plot
Functions ¶
Types ¶
type ColumnParams ¶
type ColumnParams struct {
// whether to plot this column
On bool
// name of column we're plotting
Column string
// whether to plot lines; uses the overall plot option if unset
Lines option.Option[bool]
// whether to plot points with symbols; uses the overall plot option if unset
Points option.Option[bool]
// the width of lines; uses the overall plot option if unset
LineWidth option.Option[float32]
// the size of points; uses the overall plot option if unset
PointSize option.Option[float32]
// the shape used to draw points; uses the overall plot option if unset
PointShape option.Option[plots.Shapes]
// effective range of data to plot -- either end can be fixed
Range minmax.Range32 `display:"inline"`
// full actual range of data -- only valid if specifically computed
FullRange minmax.F32 `display:"inline"`
// color to use when plotting the line / column
Color color.Color
// desired number of ticks
NTicks int
// if non-empty, this is an alternative label to use in plotting
Lbl string `label:"Label"`
// if column has n-dimensional tensor cells in each row, this is the index within each cell to plot -- use -1 to plot *all* indexes as separate lines
TensorIndex int
// specifies a column containing error bars for this column
ErrColumn string
// if true this is a string column -- plots as labels
IsString bool `edit:"-"`
// our plot, for update method
Plot *PlotEditor `copier:"-" json:"-" xml:"-" display:"-"`
}
ColumnParams are parameters for plotting one column of data
func (*ColumnParams) CopyFrom ¶
func (cp *ColumnParams) CopyFrom(fr *ColumnParams)
CopyFrom copies from other col params
func (*ColumnParams) Defaults ¶
func (cp *ColumnParams) Defaults()
Defaults sets defaults if nil vals present
func (*ColumnParams) FromMetaMap ¶
func (cp *ColumnParams) FromMetaMap(meta map[string]string)
FromMetaMap sets plot params from meta data map
func (*ColumnParams) Label ¶
func (cp *ColumnParams) Label() string
func (*ColumnParams) Update ¶
func (cp *ColumnParams) Update()
Update satisfies the core.Updater interface and will trigger display update on edits
type Plot ¶
type Plot struct {
core.WidgetBase
// Scale multiplies the plot DPI value, to change the overall scale
// of the rendered plot. Larger numbers produce larger scaling.
// Typically use larger numbers when generating plots for inclusion in
// documents or other cases where the overall plot size will be small.
Scale float32
// Plot is the Plot to display in this widget
Plot *plot.Plot `set:"-"`
}
Plot is a widget that renders a plot.Plot object. If it is not states.ReadOnly, the user can pan and zoom the graph. See PlotEditor for an interactive interface for selecting columns to view.
func NewPlot ¶
NewPlot returns a new Plot with the given optional parent: Plot is a widget that renders a plot.Plot object. If it is not states.ReadOnly, the user can pan and zoom the graph. See PlotEditor for an interactive interface for selecting columns to view.
func (*Plot) NodeType ¶
NodeType returns the *types.Type of Plot
func (*Plot) SetPlot ¶
SetPlot sets the plot to given Plot, and calls UpdatePlot to ensure it is drawn at the current size of this widget
func (*Plot) SetScale ¶
SetScale sets the [Plot.Scale]: Scale multiplies the plot DPI value, to change the overall scale of the rendered plot. Larger numbers produce larger scaling. Typically use larger numbers when generating plots for inclusion in documents or other cases where the overall plot size will be small.
func (*Plot) UpdatePlot ¶
func (pt *Plot) UpdatePlot()
UpdatePlot draws the current plot at the size of the current widget, and triggers a Render so the widget will be rendered.
type PlotEditor ¶
type PlotEditor struct {
core.Frame
// the table of data being plotted
Table *table.IndexView `set:"-"`
// the overall plot parameters
Params PlotParams
// the parameters for each column of the table
Columns []*ColumnParams `set:"-"`
// Plot is the plot object.
Plot *plot.Plot `set:"-" edit:"-" json:"-" xml:"-"`
// ConfigPlotFunc is a function to call to configure [PlotEditor.Plot], the plot.Plot that
// actually does the plotting. It is called after [Plot] is generated, and properties
// of [Plot] can be modified in it. Properties of [Plot] should not be modified outside
// of this function, as doing so will have no effect.
ConfigPlotFunc func() `json:"-" xml:"-"`
// current svg file
SVGFile core.Filename
// current csv data file
DataFile core.Filename
// currently doing a plot
InPlot bool `set:"-" edit:"-" json:"-" xml:"-"`
}
PlotEditor is a widget that provides an interactive 2D plot of selected columns of tabular data, represented by a table.IndexView into a table.Table. Other types of tabular data can be converted into this format. The user can change various options for the plot and also modify the underlying data.
func NewPlotEditor ¶
func NewPlotEditor(parent ...tree.Node) *PlotEditor
NewPlotEditor returns a new PlotEditor with the given optional parent: PlotEditor is a widget that provides an interactive 2D plot of selected columns of tabular data, represented by a table.IndexView into a table.Table. Other types of tabular data can be converted into this format. The user can change various options for the plot and also modify the underlying data.
func NewSubPlot ¶
func NewSubPlot(parent ...tree.Node) *PlotEditor
NewSubPlot returns a PlotEditor with its own separate Toolbar, suitable for a tab or other element that is not the main plot.
func (*PlotEditor) ColParamsTry ¶
func (pl *PlotEditor) ColParamsTry(colNm string) (*ColumnParams, error)
ColParamsTry returns the current column parameters by name (to access by index, just use Columns directly) Try version returns error message if not found.
func (*PlotEditor) ColumnParams ¶
func (pl *PlotEditor) ColumnParams(colNm string) *ColumnParams
ColParams returns the current column parameters by name (to access by index, just use Columns directly) returns nil if not found
func (*PlotEditor) ColumnsFrame ¶
func (pl *PlotEditor) ColumnsFrame() *core.Frame
func (*PlotEditor) ColumnsFromMetaMap ¶
func (pl *PlotEditor) ColumnsFromMetaMap(meta map[string]string)
ColumnsFromMetaMap updates all the column settings from given meta map
func (*PlotEditor) ColumnsListUpdate ¶
func (pl *PlotEditor) ColumnsListUpdate()
ColumnsListUpdate updates the list of columns
func (*PlotEditor) ConfigPlot ¶
func (pl *PlotEditor) ConfigPlot(plt *plot.Plot)
ConfigPlot configures the plot with params
func (*PlotEditor) CopyFieldsFrom ¶
func (pl *PlotEditor) CopyFieldsFrom(frm tree.Node)
func (*PlotEditor) GenPlot ¶
func (pl *PlotEditor) GenPlot()
GenPlot generates the plot and renders it to SVG It surrounds operation with InPlot true / false to prevent multiple updates
func (*PlotEditor) GenPlotBar ¶
func (pl *PlotEditor) GenPlotBar()
GenPlotBar generates a Bar plot, setting GPlot variable
func (*PlotEditor) GenPlotXY ¶
func (pl *PlotEditor) GenPlotXY()
GenPlotXY generates an XY (lines, points) plot, setting Plot variable
func (*PlotEditor) GoUpdatePlot ¶
func (pl *PlotEditor) GoUpdatePlot()
GoUpdatePlot updates the display based on current IndexView into table. this version can be called from go routines. It does Sequential() on the table.IndexView, under the assumption that it is used for tracking a the latest updates of a running process.
func (*PlotEditor) Init ¶
func (pl *PlotEditor) Init()
func (*PlotEditor) MakeToolbar ¶
func (pl *PlotEditor) MakeToolbar(p *tree.Plan)
func (*PlotEditor) NodeType ¶
func (t *PlotEditor) NodeType() *types.Type
NodeType returns the *types.Type of PlotEditor
func (*PlotEditor) OpenCSV ¶
func (pl *PlotEditor) OpenCSV(filename core.Filename, delim table.Delims)
OpenCSV opens the Table data from a csv (comma-separated values) file (or any delim)
func (*PlotEditor) OpenFS ¶
OpenFS opens the Table data from a csv (comma-separated values) file (or any delim) from the given filesystem.
func (*PlotEditor) PlotChild ¶
func (pl *PlotEditor) PlotChild() *Plot
func (*PlotEditor) PlotXAxis ¶
func (pl *PlotEditor) PlotXAxis(plt *plot.Plot, ixvw *table.IndexView) (xi int, xview *table.IndexView, err error)
PlotXAxis processes the XAxis and returns its index
func (*PlotEditor) SaveAll ¶
func (pl *PlotEditor) SaveAll(fname core.Filename)
SaveAll saves the current plot to a png, svg, and the data to a tsv -- full save Any extension is removed and appropriate extensions are added
func (*PlotEditor) SaveCSV ¶
func (pl *PlotEditor) SaveCSV(fname core.Filename, delim table.Delims)
SaveCSV saves the Table data to a csv (comma-separated values) file with headers (any delim)
func (*PlotEditor) SavePNG ¶
func (pl *PlotEditor) SavePNG(fname core.Filename)
SavePNG saves the current plot to a png, capturing current render
func (*PlotEditor) SaveSVG ¶
func (pl *PlotEditor) SaveSVG(fname core.Filename)
SaveSVG saves the plot to an svg -- first updates to ensure that plot is current
func (*PlotEditor) SetAllColumns ¶
func (pl *PlotEditor) SetAllColumns(on bool)
SetAllColumns turns all Columns on or off (except X axis)
func (*PlotEditor) SetColParams ¶
func (pl *PlotEditor) SetColParams(colNm string, on bool, fixMin bool, min float32, fixMax bool, max float32) *ColumnParams
SetColParams sets main parameters for one column
func (*PlotEditor) SetColumnsByName ¶
func (pl *PlotEditor) SetColumnsByName(nameContains string, on bool)
SetColumnsByName turns cols On or Off if their name contains given string
func (*PlotEditor) SetConfigPlotFunc ¶
func (t *PlotEditor) SetConfigPlotFunc(v func()) *PlotEditor
SetConfigPlotFunc sets the [PlotEditor.ConfigPlotFunc]: ConfigPlotFunc is a function to call to configure [PlotEditor.Plot], the plot.Plot that actually does the plotting. It is called after Plot is generated, and properties of Plot can be modified in it. Properties of Plot should not be modified outside of this function, as doing so will have no effect.
func (*PlotEditor) SetDataFile ¶
func (t *PlotEditor) SetDataFile(v core.Filename) *PlotEditor
SetDataFile sets the [PlotEditor.DataFile]: current csv data file
func (*PlotEditor) SetIndexView ¶
func (pl *PlotEditor) SetIndexView(tab *table.IndexView) *PlotEditor
SetIndexView sets the table to view and does Update to update the Column list, which will also trigger a Layout and updating of the plot on next render pass. This is safe to call from a different goroutine.
func (*PlotEditor) SetParams ¶
func (t *PlotEditor) SetParams(v PlotParams) *PlotEditor
SetParams sets the [PlotEditor.Params]: the overall plot parameters
func (*PlotEditor) SetSVGFile ¶
func (t *PlotEditor) SetSVGFile(v core.Filename) *PlotEditor
SetSVGFile sets the [PlotEditor.SVGFile]: current svg file
func (*PlotEditor) SetTable ¶
func (pl *PlotEditor) SetTable(tab *table.Table) *PlotEditor
SetTable sets the table to view and does Update to update the Column list, which will also trigger a Layout and updating of the plot on next render pass. This is safe to call from a different goroutine.
func (*PlotEditor) SizeFinal ¶
func (pt *PlotEditor) SizeFinal()
func (*PlotEditor) UpdatePlot ¶
func (pl *PlotEditor) UpdatePlot()
UpdatePlot updates the display based on current IndexView into table. This version can only be called within main goroutine for window eventloop -- use GoUpdateUplot for other-goroutine updates. It does not automatically update the table.IndexView unless it is nil or out date.
type PlotParams ¶
type PlotParams struct {
// optional title at top of plot
Title string
// type of plot to generate. For a Bar plot, items are plotted ordinally by row and the XAxis is optional
Type PlotTypes
// whether to plot lines
Lines bool `default:"true"`
// whether to plot points with symbols
Points bool
// width of lines
LineWidth float32 `default:"1"`
// size of points
PointSize float32 `default:"3"`
// the shape used to draw points
PointShape plots.Shapes
// width of bars for bar plot, as fraction of available space (1 = no gaps)
BarWidth float32 `min:"0.01" max:"1" default:"0.8"`
// if true, draw lines that connect points with a negative X-axis direction;
// otherwise there is a break in the line.
// default is false, so that repeated series of data across the X axis
// are plotted separately.
NegativeXDraw bool
// Scale multiplies the plot DPI value, to change the overall scale
// of the rendered plot. Larger numbers produce larger scaling.
// Typically use larger numbers when generating plots for inclusion in
// documents or other cases where the overall plot size will be small.
Scale float32 `default:"1,2"`
// what column to use for the common X axis. if empty or not found,
// the row number is used. This optional for Bar plots, if present and
// LegendColumn is also present, then an extra space will be put between X values.
XAxisColumn string
// optional column for adding a separate colored / styled line or bar
// according to this value, and acts just like a separate Y variable,
// crossed with Y variables.
LegendColumn string
// position of the Legend
LegendPosition plot.LegendPosition `display:"inline"`
// rotation of the X Axis labels, in degrees
XAxisRotation float32
// optional label to use for XAxis instead of column name
XAxisLabel string
// optional label to use for YAxis -- if empty, first column name is used
YAxisLabel string
// our plot, for update method
Plot *PlotEditor `copier:"-" json:"-" xml:"-" display:"-"`
}
PlotParams are parameters for overall plot
func (*PlotParams) CopyFrom ¶
func (pp *PlotParams) CopyFrom(fr *PlotParams)
CopyFrom copies from other col params
func (*PlotParams) Defaults ¶
func (pp *PlotParams) Defaults()
Defaults sets defaults if nil vals present
func (*PlotParams) FromMeta ¶
func (pp *PlotParams) FromMeta(dt *table.Table)
FromMeta sets plot params from meta data
func (*PlotParams) FromMetaMap ¶
func (pp *PlotParams) FromMetaMap(meta map[string]string)
FromMetaMap sets plot params from meta data map
func (*PlotParams) Update ¶
func (pp *PlotParams) Update()
Update satisfies the core.Updater interface and will trigger display update on edits
type PlotTypes ¶
type PlotTypes int32 //enums:enum
PlotTypes are different types of plots
const PlotTypesN PlotTypes = 2
PlotTypesN is the highest valid value for type PlotTypes, plus one.
func PlotTypesValues ¶
func PlotTypesValues() []PlotTypes
PlotTypesValues returns all possible values for the type PlotTypes.
func (PlotTypes) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*PlotTypes) SetString ¶
SetString sets the PlotTypes value from its string representation, and returns an error if the string is invalid.
func (*PlotTypes) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type TableXY ¶
type TableXY struct {
// the index view of data table to plot from
Table *table.IndexView
// the indexes of the tensor columns to use for the X and Y data, respectively
XColumn, YColumn int
// numer of elements in each row of data -- 1 for scalar, > 1 for multi-dimensional
XRowSz, YRowSz int
// the indexes of the element within each tensor cell if cells are n-dimensional, respectively
XIndex, YIndex int
// the column to use for returning a label using Label interface -- for string cols
LabelColumn int
// the column to use for returning errorbars (+/- given value) -- if YColumn is tensor then this must also be a tensor and given YIndex used
ErrColumn int
// range constraints on Y values
YRange minmax.Range32
}
TableXY selects two columns from a table.Table data table to plot in a gonum plot, satisfying the plot/plots.XYer and .Valuer interfaces (for bar charts). For Tensor-valued cells, Index's specify tensor cell. Also satisfies the plot/plots.Labeler interface for labels attached to a line, and plot/plots.YErrorer for error bars.
func NewTableXY ¶
func NewTableXY(dt *table.IndexView, xcol, xtsrIndex, ycol, ytsrIndex int, yrng minmax.Range32) (*TableXY, error)
NewTableXY returns a new XY plot view onto the given IndexView of table.Table (makes a copy), from given column indexes, and tensor indexes within each cell. Column indexes are enforced to be valid, with an error message if they are not.
func NewTableXYName ¶
func NewTableXYName(dt *table.IndexView, xi, xtsrIndex int, ycol string, ytsrIndex int, yrng minmax.Range32) (*TableXY, error)
NewTableXYName returns a new XY plot view onto the given IndexView of table.Table (makes a copy), from given column name and tensor indexes within each cell. Column indexes are enforced to be valid, with an error message if they are not.
func (*TableXY) FilterValues ¶
func (txy *TableXY) FilterValues()
FilterValues removes items with NaN values, and out of Y range
func (*TableXY) Label ¶
Label returns a label for given row in table, using plot/plots.Labeler interface
func (*TableXY) TRowXValue ¶
TRowXValue returns an x value at given actual row in table
func (*TableXY) Validate ¶
Validate returns error message if column indexes are invalid, else nil it also sets column indexes to 0 so nothing crashes.