gplot

package
v0.2.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2026 License: MIT Imports: 8 Imported by: 1

Documentation

Overview

`gplot` package provides functions for data visualization using gonum/plot.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBarChart

func CreateBarChart(config BarChartConfig, data any) *plot.Plot

CreateBarChart generates and returns a plot.Plot object based on BarChartConfig. The Data field can be of type []float64, *insyra.DataList, or insyra.IDataList.

func CreateFunctionPlot added in v0.0.12

func CreateFunctionPlot(config FunctionPlotConfig, function func(x float64) float64) *plot.Plot

CreateFunctionPlot generates and returns a plot.Plot object based on FunctionPlotConfig.

func CreateHeatmapChart added in v0.2.6

func CreateHeatmapChart(config HeatmapChartConfig, data any) *plot.Plot

CreateHeatmapChart generates and returns a plot.Plot object based on HeatmapChartConfig. The Data field can be of type [][]float64, *insyra.DataTable, or insyra.IDataTable.

func CreateHistogram

func CreateHistogram(config HistogramConfig, data any) *plot.Plot

CreateHistogram generates and returns a plot.Plot object based on HistogramConfig. The Data field can be of type []float64, *insyra.DataList, or insyra.IDataList.

func CreateLineChart added in v0.0.11

func CreateLineChart(config LineChartConfig, data any) *plot.Plot

CreateLineChart generates and returns a plot.Plot object based on LineChartConfig. The Data field can be of type map[string][]float64, []*insyra.DataList, or []insyra.IDataList.

func CreateScatterPlot added in v0.2.6

func CreateScatterPlot(config ScatterPlotConfig, data any) *plot.Plot

CreateScatterPlot generates and returns a plot.Plot object based on ScatterPlotConfig. The Data field can be of type map[string][]float64, []*insyra.DataList, or []insyra.IDataList.

func CreateStepChart added in v0.2.6

func CreateStepChart(config StepChartConfig, data any) *plot.Plot

CreateStepChart generates and returns a plot.Plot object based on StepChartConfig. The Data field can be of type map[string][]float64, []*insyra.DataList, or []insyra.IDataList.

func SaveChart

func SaveChart(plt *plot.Plot, filename string)

SaveChart saves the plot to a file. Supported file formats: .jpg|.jpeg|.pdf|.png|.svg|.tex|.tif|.tiff Automatically determine the file extension based on the filename.

Types

type BarChartConfig

type BarChartConfig struct {
	Title     string    // Title of the chart.
	XAxis     []string  // X-axis data (categories).
	XAxisName string    // Optional: X-axis name.
	YAxisName string    // Optional: Y-axis name.
	BarWidth  float64   // Optional: Bar width for each bar in the chart. Default is 20.
	ErrorBars []float64 // Optional: Error bar values for each bar. If provided, must match the length of Data.
}

BarChartConfig defines the configuration for a single series bar chart.

type FunctionPlotConfig added in v0.0.12

type FunctionPlotConfig struct {
	Title     string  // Title of the chart.
	XAxisName string  // Label for the X-axis.
	YAxisName string  // Label for the Y-axis.
	XMin      float64 // Minimum value of X (optional).
	XMax      float64 // Maximum value of X (optional).
	YMin      float64 // Minimum value of Y (optional).
	YMax      float64 // Maximum value of Y (optional).
}

FunctionPlotConfig defines the configuration for a function plot.

type HeatmapChartConfig added in v0.2.6

type HeatmapChartConfig struct {
	Title     string    // Title of the chart.
	XAxisName string    // Optional: X-axis name.
	YAxisName string    // Optional: Y-axis name.
	XAxis     []float64 // Optional: X-axis coordinates. If not provided, will use indices.
	YAxis     []float64 // Optional: Y-axis coordinates. If not provided, will use indices.
	Colors    int       // Optional: Number of colors in the palette. Default is 20.
	Alpha     float64   // Optional: Alpha (transparency) for colors. Default is 1.0.
}

HeatmapChartConfig defines the configuration for a heatmap chart.

type HistogramConfig

type HistogramConfig struct {
	Title     string // Title of the chart.
	XAxisName string // Optional: X-axis name.
	YAxisName string // Optional: Y-axis name.
	Bins      int    // Number of bins for the histogram.
}

HistogramConfig defines the configuration for a single series histogram.

type LineChartConfig added in v0.0.11

type LineChartConfig struct {
	Title     string    // Title of the chart.
	XAxis     []float64 // X-axis data.
	XAxisName string    // Optional: X-axis name.
	YAxisName string    // Optional: Y-axis name.
}

LineChartConfig defines the configuration for a multi-series line chart.

type ScatterPlotConfig added in v0.2.6

type ScatterPlotConfig struct {
	Title     string // Title of the chart.
	XAxisName string // Optional: X-axis name.
	YAxisName string // Optional: Y-axis name.
}

ScatterPlotConfig defines the configuration for a multi-series scatter plot.

type StepChartConfig added in v0.2.6

type StepChartConfig struct {
	Title     string    // Title of the chart.
	XAxis     []float64 // X-axis data.
	XAxisName string    // Optional: X-axis name.
	YAxisName string    // Optional: Y-axis name.
	StepStyle string    // Optional: Step style - "pre", "mid", "post". Default is "post".
}

StepChartConfig defines the configuration for a multi-series step chart.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL