Documentation
¶
Overview ¶
Package plotter provides SVG visualization for ODE solutions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PlotData ¶
type PlotData struct {
PlotID string
Margin map[string]float64
PlotWidth float64
PlotHeight float64
Xmin float64
Xmax float64
Ymin float64
Ymax float64
Series []Series
}
PlotData contains metadata about the last rendered plot. This can be used for interactive features like crosshairs and tooltips.
type SVGPlotter ¶
type SVGPlotter struct {
Width float64
Height float64
Margin map[string]float64
PlotWidth float64
PlotHeight float64
Title string
XLabel string
YLabel string
Series []Series
LastPlot *PlotData
}
SVGPlotter creates SVG plots with customizable styling.
func NewSVGPlotter ¶
func NewSVGPlotter(width, height float64) *SVGPlotter
NewSVGPlotter creates a new SVG plotter with the given dimensions.
func (*SVGPlotter) AddSeries ¶
func (p *SVGPlotter) AddSeries(x, y []float64, label, color string) *SVGPlotter
AddSeries adds a data series to the plot. If color is empty, a default color from a palette will be used.
func (*SVGPlotter) Render ¶
func (p *SVGPlotter) Render() string
Render generates the SVG string and stores metadata in LastPlot.
func (*SVGPlotter) SetTitle ¶
func (p *SVGPlotter) SetTitle(t string) *SVGPlotter
SetTitle sets the plot title.
func (*SVGPlotter) SetXLabel ¶
func (p *SVGPlotter) SetXLabel(s string) *SVGPlotter
SetXLabel sets the X-axis label.
func (*SVGPlotter) SetYLabel ¶
func (p *SVGPlotter) SetYLabel(s string) *SVGPlotter
SetYLabel sets the Y-axis label.
Click to show internal directories.
Click to hide internal directories.