plot

package
v0.0.0-...-875ebbc Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Go package for Plotting.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plot

type Plot struct {
	// The data to be plotted.
	Data []float64

	// The width of the plot.
	Width int

	// The height of the plot.
	Height int

	// The color of the plot.
	Color color.Color

	// The name of the plot.
	Name string

	// The name of the file to save the plot to.
	FileName string

	// The minimum value of the plot.
	Min float64

	// The maximum value of the plot.
	Max float64

	// The number of bins to use for the plot.
	Bins int

	// The number of bins to use for the plot.
	BinWidth float64

	// The number of bins to use for the plot.
	BinHeight float64

	// The number of bins to use for the plot.
	BinCounts []int

	// The number of bins to use for the plot.
	BinCenters []float64
}

Plot is a struct that holds the data to be plotted.

func NewPlot

func NewPlot(data []float64, width int, height int, color color.Color, name string, fileName string) *Plot

NewPlot returns a new plot.

func (*Plot) Box

func (p *Plot) Box()

Box plots the box plot of the data.

func (*Plot) GetBinCenters

func (p *Plot) GetBinCenters() []float64

GetBinCenters returns the centers of the bins.

func (*Plot) GetBinCounts

func (p *Plot) GetBinCounts() []int

GetBinCounts returns the counts of the bins.

func (*Plot) GetBinHeight

func (p *Plot) GetBinHeight() float64

GetBinHeight returns the height of the bins.

func (*Plot) GetBinWidth

func (p *Plot) GetBinWidth() float64

GetBinWidth returns the width of the bins.

func (*Plot) GetBins

func (p *Plot) GetBins() int

GetBins returns the number of bins.

func (*Plot) GetColor

func (p *Plot) GetColor() color.Color

GetColor returns the color.

func (*Plot) GetData

func (p *Plot) GetData() []float64

GetData returns the data.

func (*Plot) GetFileName

func (p *Plot) GetFileName() string

GetFileName returns the file name.

func (*Plot) GetHeight

func (p *Plot) GetHeight() int

GetHeight returns the height.

func (*Plot) GetMinMax

func (p *Plot) GetMinMax() (float64, float64)

GetMinMax returns the minimum and maximum values of the plot.

func (*Plot) GetName

func (p *Plot) GetName() string

GetName returns the name.

func (*Plot) GetWidth

func (p *Plot) GetWidth() int

GetWidth returns the width.

func (*Plot) Histogram

func (p *Plot) Histogram()

Histogram plots the histogram of the data.

func (*Plot) Line

func (p *Plot) Line()

Line plots the line plot of the data.

func (*Plot) Scatter

func (p *Plot) Scatter()

Scatter plots the scatter plot of the data.

func (*Plot) SetBins

func (p *Plot) SetBins(bins int)

SetBins sets the number of bins to use for the plot.

func (*Plot) SetColor

func (p *Plot) SetColor(color color.Color)

SetColor sets the color.

func (*Plot) SetData

func (p *Plot) SetData(data []float64)

SetData sets the data.

func (*Plot) SetFileName

func (p *Plot) SetFileName(fileName string)

SetFileName sets the file name.

func (*Plot) SetHeight

func (p *Plot) SetHeight(height int)

SetHeight sets the height.

func (*Plot) SetMax

func (p *Plot) SetMax(max float64)

SetMax sets the maximum value of the plot.

func (*Plot) SetMin

func (p *Plot) SetMin(min float64)

SetMin sets the minimum value of the plot.

func (*Plot) SetMinMax

func (p *Plot) SetMinMax(min float64, max float64)

SetMinMax sets the minimum and maximum values of the plot.

func (*Plot) SetName

func (p *Plot) SetName(name string)

SetName sets the name.

func (*Plot) SetWidth

func (p *Plot) SetWidth(width int)

SetWidth sets the width.

Jump to

Keyboard shortcuts

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