plotly

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package plotly implements plotting in Jupyter Notebooks using github.com/janpfeifer/gonb (Notebook Kernel) and the Plotly github.com/MetalBlueberry/go-plotly library.

Use New to create a new Config object, and after configuring it, use Config.Plot to draw the plot.

Features:

  • B-spline function, visible by default.
  • Control Points, visible by default.
  • Derivative, non-visible by default.
  • Basis functions, non-visible by default.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config holds a plot configuration that can be changed. Once finished, call the method [Plot] to actually plot.

func New

func New(b *bsplines.BSpline) *Config

New returns a Config object that can be changed. Once finished, call Config.Plot to draw the plot in the Jupyter notebook.

func (*Config) Plot

func (c *Config) Plot() error

Plot using the current configuration. It returns an error if plotting failed for some reason.

func (*Config) WithMargin

func (c *Config) WithMargin(marginRatio float64) *Config

WithMargin defines how much space (relative to the defined B-spline range) to plot. It defaults to 0.1, and it's handy to see how the curve is going to extrapolate beyond its boundaries.

func (*Config) WithNumPlotPoints

func (c *Config) WithNumPlotPoints(numPlotPoints int) *Config

WithNumPlotPoints set the number of plot points to evaluate. Default is 1000.

Jump to

Keyboard shortcuts

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