class Ishi::Gnuplot

Overview

Gnuplot rendering engine.

Requires "gnuplot" be installed and available.

Defined in:

ishi/gnuplot.cr
ishi/html.cr
ishi/iterm2.cr
ishi/text.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(prologue : Enumerable(String) = [] of String, epilogue : Enumerable(String) = ["exit"]) #

Creates a new instance of the gnuplot engine.


[View source]

Instance Method Detail

def clear #

Clears the chart.


[View source]
def dim #

Returns the dimensionality of the chart.

All plots in a chart must have the same dimensionality (it's not currently possible to plot 2D and 3D data simultaneously).


[View source]
def plot(ydata : Indexable(Y), title : String | Nil = nil, style : Symbol = :lines) forall Y #

Plots y using x ranging from 0 to N-1.


[View source]
def plot(expression : String, title : String | Nil = nil, style : Symbol | Nil = nil) #

Plots a mathematical expression.


[View source]
def plot(xdata : Indexable(X), ydata : Indexable(Y), title : String | Nil = nil, style : Symbol = :lines) forall X, Y #

Plots x and y.


[View source]
def plot(xdata : Indexable(X), ydata : Indexable(Y), zdata : Indexable(Z), title : String | Nil = nil, style : Symbol = :points) forall X, Y, Z #

Plots x, y and z.


[View source]
def run(commands : Enumerable(String)) #

Runs a "gnuplot" process and feeds it commands.

Returns an IO instance with the output.


[View source]
def show #

Shows the chart.


[View source]
def show(**options) #

[View source]
def size #

Returns the number of plots.


[View source]
def xlabel(xlabel : String) #

Sets the label of the x axis.


[View source]
def xrange(xrange : Range(Float64, Float64) | Range(Int32, Int32)) #

Sets the range of the x axis.


[View source]
def ylabel(ylabel : String) #

Sets the label of the y axis.


[View source]
def yrange(yrange : Range(Float64, Float64) | Range(Int32, Int32)) #

Sets the range of the y axis.


[View source]
def zlabel(zlabel : String) #

Sets the label of the z axis.


[View source]
def zrange(zrange : Range(Float64, Float64) | Range(Int32, Int32)) #

Sets the range of the z axis.


[View source]