abstract class Ishi::Base
- Ishi::Base
- Reference
- Object
Overview
Supported methods.
Direct Known Subclasses
Defined in:
ishi/base.crInstance Method Summary
-
#boxwidth(boxwidth : Float64)
Sets the default width of boxes in the boxes, boxerrorbars, candlesticks and histograms styles.
-
#canvas_size(width : Int32, height : Int32)
Sets the size of the terminal canvas.
-
#canvas_size(width : Float64, height : Float64)
Sets the size of the terminal canvas.
-
#charts(rows : Int32, cols : Int32)
Changes the number of charts in the figure.
-
#charts(rows : Int32, cols : Int32, &)
Changes the number of charts in the figure.
-
#imshow(data : Indexable(Indexable(D)), **options) forall D
Displays an image.
-
#margin(left : Int32 | Bool = false, right : Int32 | Bool = false, top : Int32 | Bool = false, bottom : Int32 | Bool = false)
Sets the margin.
-
#margin(left : Float64 | Bool = false, right : Float64 | Bool = false, top : Float64 | Bool = false, bottom : Float64 | Bool = false)
Sets the margin.
-
#palette(name : Symbol, colorbox : Bool = true)
Sets the palette.
-
#plot(xdata : Indexable(T), ydata : Indexable(U), zdata : Indexable(V), format : String? = nil, *, title : String? = nil, style : Symbol = :points, **options) forall T, U, V
Plots
x
,y
andz
. -
#plot(ydata : Indexable(Y), format : String? = nil, *, title : String? = nil, style : Symbol = :lines, **options) forall Y
Plots
y
usingx
ranging from0
toN-1
. -
#plot(xdata : Indexable(M), ydata : Indexable(N), format : String? = nil, *, title : String? = nil, style : Symbol = :points, **options) forall M, N
Plots
x
andy
. -
#plot(expression : String, format : String? = nil, *, title : String? = nil, style : Symbol? = nil, **options)
Plots a mathematical expression.
-
#scatter(xdata : Indexable(M), ydata : Indexable(N), format : String? = nil, *, title : String? = nil, style : Symbol = :dots, **options) forall M, N
Scatter plots
x
andy
. -
#scatter(xdata : Indexable(T), ydata : Indexable(U), zdata : Indexable(V), format : String? = nil, *, title : String? = nil, style : Symbol = :dots, **options) forall T, U, V
Scatter plots
x
,y
andz
. -
#show(**options)
Shows the chart(s).
-
#show_border(show : Bool)
Shows/hides the chart border.
-
#show_colorbox(show : Bool)
Shows/hides the chart colorbox.
-
#show_key(show : Bool)
Shows/hides the chart key.
-
#show_xtics(show : Bool)
Shows/hides the chart xtics.
-
#show_ytics(show : Bool)
Shows/hides the chart ytics.
-
#size
Returns the number of charts in the figure.
-
#view(xrot : Float64, zrot : Float64)
Sets the viewing angle for 3D charts.
-
#view(xrot : Int32, zrot : Int32)
Sets the viewing angle for 3D charts.
-
#xlabel(xlabel : String)
Sets the label of the
x
axis. -
#xrange(xrange : Range(Float64, Float64) | Range(Int32, Int32))
Sets the range of the
x
axis. -
#xtics(xtics : Hash(Float64, String))
Sets non-numeric labels on the x-axis.
-
#ylabel(ylabel : String)
Sets the label of the
y
axis. -
#yrange(yrange : Range(Float64, Float64) | Range(Int32, Int32))
Sets the range of the
y
axis. -
#zlabel(zlabel : String)
Sets the label of the
z
axis. -
#zrange(zrange : Range(Float64, Float64) | Range(Int32, Int32))
Sets the range of the
z
axis.
Instance Method Detail
Sets the default width of boxes in the boxes, boxerrorbars, candlesticks and histograms styles.
For information on setting the box width, see: Boxwidth.
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
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
Displays an image.
data is scalar image data.
Data is visualized using a colormap.
Sets the margin.
For information on setting/unsetting the margin, see: Margin.
Sets the margin.
For information on setting/unsetting the margin, see: Margin.
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.
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
.
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
.
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
.
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
.
Scatter plots x
and y
.
title is the title of the plot.
Scatter plots x
, y
and z
.
title is the title of the plot.
Shows/hides the chart border.
For information on setting/unsetting the border, see: Border.
Shows/hides the chart colorbox.
For information on setting/unsetting the colorbox, see: Colorbox.
Shows/hides the chart key.
For information on setting/unsetting the key, see: Key.
Shows/hides the chart xtics.
For information on setting/unsetting the xtics, see: Xtics.
Shows/hides the chart ytics.
For information on setting/unsetting the ytics, see: Ytics.
Sets the viewing angle for 3D charts.
For information on setting the viewing angle, see: View.
Sets the viewing angle for 3D charts.
For information on setting the viewing angle, see: View.
Sets non-numeric labels on the x-axis.
This translates to set xtics ({"
see: Xtics list
Example:
plot(x, y).xtics({1.0 => "Jan", 6.0 => "Jun", 12.0 => "Dec"})