Versions in this module Expand all Collapse all v0 v0.1.4 Jun 1, 2024 v0.1.3 May 5, 2024 Changes in this version type Plot + func (pt *Plot) SetPixels(img *image.RGBA) v0.1.2 May 1, 2024 v0.1.1 May 1, 2024 Changes in this version + var DefaultFontFamily = "" + var ErrInfinity = errors.New("plotter: infinite data point") + var ErrNoData = errors.New("plotter: no data points") + var UTCUnixTime = UnixTimeIn(time.UTC) + func CheckFloats(fs ...float32) error + func CheckNaNs(fs ...float32) bool + func Range(vs Valuer) (min, max float32) + func UnixTimeIn(loc *time.Location) func(t float32) time.Time + func XYRange(xys XYer) (xmin, xmax, ymin, ymax float32) + type Axis struct + AutoRescale bool + Axis math32.Dims + Label Text + Line LineStyle + Max float32 + Min float32 + Padding units.Value + Scale Normalizer + TickLength units.Value + TickLine LineStyle + TickText Text + Ticker Ticker + func (ax *Axis) Defaults(dim math32.Dims) + func (ax *Axis) Norm(x float32) float32 + func (ax *Axis) SanitizeRange() + type ConstantTicks []Tick + func (ts ConstantTicks) Ticks(float32, float32) []Tick + type DataRanger interface + DataRange func() (xmin, xmax, ymin, ymax float32) + type DefaultTicks struct + func (DefaultTicks) Ticks(min, max float32) []Tick + type InvertedScale struct + func (is InvertedScale) Normalize(min, max, x float32) float32 + type Labeller interface + Label func(i int) string + type Legend struct + Entries []LegendEntry + FillColor color.Color + Position LegendPosition + TextStyle TextStyle + ThumbnailWidth units.Value + func (lg *Legend) Add(name string, thumbs ...Thumbnailer) + func (lg *Legend) Defaults() + type LegendEntry struct + Text string + Thumbs []Thumbnailer + type LegendPosition struct + Left bool + Top bool + XOffs units.Value + YOffs units.Value + func (lg *LegendPosition) Defaults() + type LineStyle struct + Color image.Image + Dashes []float32 + Width units.Value + func (ls *LineStyle) Defaults() + func (ls *LineStyle) Draw(pt *Plot, start, end math32.Vector2) bool + func (ls *LineStyle) SetStroke(pt *Plot) bool + type LinearScale struct + func (LinearScale) Normalize(min, max, x float32) float32 + type LogScale struct + func (LogScale) Normalize(min, max, x float32) float32 + type LogTicks struct + Prec int + func (t LogTicks) Ticks(min, max float32) []Tick + type Normalizer interface + Normalize func(min, max, x float32) float32 + type Plot struct + Background color.Color + DPI float32 + Legend Legend + Paint *paint.Context + Pixels *image.RGBA + PlotBox math32.Box2 + Plotters []Plotter + Size image.Point + StdTextStyle styles.Text + Title Text + X Axis + Y Axis + func New() *Plot + func (pt *Plot) Add(ps ...Plotter) + func (pt *Plot) ClosestDataToPixel(px, py int) (plt Plotter, idx int, dist float32, data, pixel math32.Vector2) + func (pt *Plot) Defaults() + func (pt *Plot) Draw() + func (pt *Plot) HideAxes() + func (pt *Plot) HideX() + func (pt *Plot) HideY() + func (pt *Plot) NominalX(names ...string) + func (pt *Plot) NominalY(names ...string) + func (pt *Plot) PX(v float32) float32 + func (pt *Plot) PY(v float32) float32 + func (pt *Plot) Resize(sz image.Point) + func (pt *Plot) SVGString() string + func (pt *Plot) SVGToFile(filename string) error + func (pt *Plot) SaveImage(filename string) error + func (pt *Plot) UpdateRange() + func (pt *Plot) UpdateRangeFromPlotter(d Plotter) + type Plotter interface + Plot func(pt *Plot) + XYData func() (data XYer, pixels XYer) + type Text struct + PaintText paint.Text + Style TextStyle + Text string + func (tx *Text) Config(pt *Plot) + func (tx *Text) Defaults() + func (tx *Text) Draw(pt *Plot, pos math32.Vector2) + func (tx *Text) PosX(width float32) math32.Vector2 + func (tx *Text) PosY(height float32) math32.Vector2 + type TextStyle struct + Align styles.Aligns + Padding units.Value + Rotation float32 + func (ts *TextStyle) Defaults() + func (ts *TextStyle) ToDots(uc *units.Context) + type Thumbnailer interface + Thumbnail func(pt *Plot) + type Tick struct + Label string + Value float32 + func (tk *Tick) IsMinor() bool + type Ticker interface + Ticks func(min, max float32) []Tick + type TickerFunc func(min, max float32) []Tick + func (f TickerFunc) Ticks(min, max float32) []Tick + type TimeTicks struct + Format string + Ticker Ticker + Time func(t float32) time.Time + func (t TimeTicks) Ticks(min, max float32) []Tick + type Valuer interface + Len func() int + Value func(i int) float32 + type Values []float32 + func CopyValues(vs Valuer) (Values, error) + func (vs Values) Len() int + func (vs Values) Value(i int) float32 + type XValues struct + func (xs XValues) Value(i int) float32 + type XYValues struct + func (xy XYValues) XY(i int) (float32, float32) + type XYZ struct + X float32 + Y float32 + Z float32 + type XYZer interface + Len func() int + XY func(i int) (float32, float32) + XYZ func(i int) (float32, float32, float32) + type XYZs []XYZ + func CopyXYZs(data XYZer) (XYZs, error) + func (xyz XYZs) Len() int + func (xyz XYZs) XY(i int) (float32, float32) + func (xyz XYZs) XYZ(i int) (float32, float32, float32) + type XYer interface + Len func() int + XY func(i int) (x, y float32) + type XYs []math32.Vector2 + func CopyXYs(data XYer) (XYs, error) + func PlotXYs(plt *Plot, data XYs) XYs + func (xys XYs) Len() int + func (xys XYs) XY(i int) (float32, float32) + type YValues struct + func (ys YValues) Value(i int) float32