class

Ishi::Base

Inherits Reference / Object

Supported methods.

Instance methods

boxwidth(boxwidth : Float64)

Sets the default width of boxes in the boxes, boxerrorbars, candlesticks and histograms styles.

For information on setting the box width, see: Boxwidth.

Source
canvas_size(width : Float64, height : Float64)

Sets the size of the terminal canvas.

Source
canvas_size(width : Int32, height : Int32)

Sets the size of the terminal canvas.

Source
charts(rows : Int32, cols : Int32)

Changes the number of charts in the figure.

By default a figure has one chart. This call changes the number of charts in the figure. The original chart is preserved and becomes the chart in the first row, first column of the new layout.

Returns the charts.

figure = Ishi.new
charts = figure.charts(2, 2)
charts[0].plot([1, 2, 3, 4])
charts[1].plot([2, 3, 4, 1])
  ...
figure.show
Source
charts(rows : Int32, cols : Int32, &)

Changes the number of charts in the figure.

By default a figure has one chart. This call changes the number of charts in the figure. The original chart is preserved and becomes the chart in the first row, first column of the new layout.

Yields each chart as the default receiver of the supplied block. Block arguments are i (the i-th chart in the figure), row and col (the row and column of the chart).

figure = Ishi.new
figure.charts(2, 2) do |i|
  plot([1, 2, 3, 4].rotate(i))
    ...
end
figure.show
Source
imshow(data : Indexable(Indexable(D)), **options) forall D

Displays an image.

data is scalar image data.

Data is visualized using a colormap.

Source
margin(left : Float64 | Bool = false, right : Float64 | Bool = false, top : Float64 | Bool = false, bottom : Float64 | Bool = false)

Sets the margin.

For information on setting/unsetting the margin, see: Margin.

Source
margin(left : Int32 | Bool = false, right : Int32 | Bool = false, top : Int32 | Bool = false, bottom : Int32 | Bool = false)

Sets the margin.

For information on setting/unsetting the margin, see: Margin.

Source
palette(name : Symbol, colorbox : Bool = true)

Sets the palette.

name is :gray or one of the available color palettes: :hot, :inferno, :jet, :magma, :plasma or :viridis

Optionally, shows/hides the chart colorbox based on the value of colorbox.

Source
plot(xdata : Indexable(T), ydata : Indexable(U), zdata : Indexable(V), format : String | Nil = nil, *, title : String | Nil = nil, style : Symbol = :points, **options) forall T, U, V

Plots x, y and z.

title is the title of the plot. style is the drawing style. Supported styles include :surface, :circles, :lines, :points and :dots.

Source
plot(ydata : Indexable(Y), format : String | Nil = nil, *, title : String | Nil = nil, style : Symbol = :lines, **options) forall Y

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

title is the title of the plot. style is the drawing style. Supported styles include :boxes, :lines, :points, :linespoints and :dots.

Source
plot(xdata : Indexable(M), ydata : Indexable(N), format : String | Nil = nil, *, title : String | Nil = nil, style : Symbol = :points, **options) forall M, N

Plots x and y.

title is the title of the plot. style is the drawing style. Supported styles include :boxes, :lines, :points, :linespoints and :dots.

Source
plot(expression : String, format : String | Nil = nil, *, title : String | Nil = nil, style : Symbol | Nil = nil, **options)

Plots a mathematical expression.

plot("sin(x) * cos(x)")
plot("3.5 * x + 1.5")

For information on gnuplot mathematical expressions, see: Expressions.

title is the title of the plot. style is the drawing style. Supported styles include :lines and :points.

Source
scatter(xdata : Indexable(M), ydata : Indexable(N), format : String | Nil = nil, *, title : String | Nil = nil, style : Symbol = :dots, **options) forall M, N

Scatter plots x and y.

title is the title of the plot.

Source
scatter(xdata : Indexable(T), ydata : Indexable(U), zdata : Indexable(V), format : String | Nil = nil, *, title : String | Nil = nil, style : Symbol = :dots, **options) forall T, U, V

Scatter plots x, y and z.

title is the title of the plot.

Source
show

Shows the chart(s).

Source
show_border(show : Bool)

Shows/hides the chart border.

For information on setting/unsetting the border, see: Border.

Source
show_colorbox(show : Bool)

Shows/hides the chart colorbox.

For information on setting/unsetting the colorbox, see: Colorbox.

Source
show_key(show : Bool)

Shows/hides the chart key.

For information on setting/unsetting the key, see: Key.

Source
show_xtics(show : Bool)

Shows/hides the chart xtics.

For information on setting/unsetting the xtics, see: Xtics.

Source
show_ytics(show : Bool)

Shows/hides the chart ytics.

For information on setting/unsetting the ytics, see: Ytics.

Source
size

Returns the number of charts in the figure.

Source
view(xrot : Float64, zrot : Float64)

Sets the viewing angle for 3D charts.

For information on setting the viewing angle, see: View.

Source
view(xrot : Int32, zrot : Int32)

Sets the viewing angle for 3D charts.

For information on setting the viewing angle, see: View.

Source
xlabel(xlabel : String)

Sets the label of the x axis.

Source
xrange(xrange : Range(Float64, Float64) | Range(Int32, Int32))

Sets the range of the x axis.

Source
xtics(xtics : Hash(Float64, String))

Sets non-numeric labels on the x-axis.

This translates to set xtics ({"<label>"} <pos> {<level>} {,{"<label>"}...})

see: Xtics list

Example:

plot(x, y).xtics({1.0 => "Jan", 6.0 => "Jun", 12.0 => "Dec"})
Source
ylabel(ylabel : String)

Sets the label of the y axis.

Source
yrange(yrange : Range(Float64, Float64) | Range(Int32, Int32))

Sets the range of the y axis.

Source
zlabel(zlabel : String)

Sets the label of the z axis.

Source
zrange(zrange : Range(Float64, Float64) | Range(Int32, Int32))

Sets the range of the z axis.

Source