class

Cryplot::Plot

Inherits Cryplot::BasePlot / Reference / Object

Class used to create a plot containing graphical elements

Constructors

Instance methods

annotate(x : Number, y : Number, text : String, options : String = "")

Add a text annotation at the specified position. Position can be in data coordinates (default), graph coordinates (0-1), or screen coordinates.

Source
annotate_graph(x : Number, y : Number, text : String, options : String = "")

Add a text annotation at graph coordinates (0-1 range).

Source
arrow(x1 : Number, y1 : Number, x2 : Number, y2 : Number, options : String = "")

Add an arrow from (x1, y1) to (x2, y2).

Source
arrow_graph(x1 : Number, y1 : Number, x2 : Number, y2 : Number, options : String = "")

Add an arrow using graph coordinates (0-1 range).

Source
box_width_absolute(val : Float64)

Set the default width of boxes in plots containing boxes (in absolute mode). In absolute mode, a unit width is equivalent to one unit of length along the x axis.

Source
box_width_relative(val : Float64)

Set the default width of boxes in plots containing boxes (in relative mode). In relative mode, a unit width is equivalent to setting the boxes side by side.

Source
colorbar_label(label : String)

Set the colorbar label for heatmaps.

Source
contour_levels(n : Int32)

Set the number of contour levels.

Source
draw_boxes(name : String, xcol : String | Int32, ycol : String | Int32, xwidthcol : String | Int32)

Draw boxes with given values at @p xcol and @p ycol columns in file @p name as well as the box widths @p xwidthcol.

Source
draw_boxes(name : String, xcol : String | Int32, ycol : String | Int32)

Draw boxes with given values at @p xcol and @p ycol columns in file @p name.

Source
draw_boxes(x : X, y : Y, xwidth : XW) : Draw forall X, Y, XW

Draw boxes with given @p x and @p y vectors as well as the box widths @p xwidth.

Source
draw_boxes(x : X, y : Y) : Draw forall X, Y

Draw boxes with given @p x and @p y vectors.

Source
draw_boxes_with_error_bars_y(name : String, xcol : String | Int32, ycol : String | Int32, ylowcol : String | Int32, yhighcol : String | Int32)

Draw boxes with error bars along y with given values at @p xcol, @p ycol, @p ylowcol, and @p yhighcol columns in file @p name.

Source
draw_boxes_with_error_bars_y(name : String, xcol : String | Int32, ycol : String | Int32, ydeltacol : String | Int32)

Draw boxes with error bars along y with given values at @p xcol, @p ycol, @p ydeltacol columns in file @p name.

Source
draw_boxes_with_error_bars_y(x : X, y : Y, ylow : YL, yhigh : YH) : Draw forall X, Y, YL, YH

Draw boxes with error bars along y with given @p x, @p y, @p ylow, and @p yhigh vectors.

Source
draw_boxes_with_error_bars_y(x : X, y : Y, ydelta : YD) : Draw forall X, Y, YD

Draw boxes with error bars along y with given @p x, @p y, @p ydelta vectors.

Source
draw_boxplot(data : Array(Array(Float64)), labels : Array(String) | Nil = nil)

Draw a box plot (box-and-whisker plot) for the given data. Each element in data represents a group/category.

Source
draw_boxplot(data : Array(Float64), label : String = "Data")

Draw a single box plot for a data vector.

Source
draw_broken_curve(x : X, y : Y) : Draw forall X, Y

Draw a curve with given @p x and @p y vectors, breaking this curve whenever NaN is found in @p x or @p y.

Source
draw_broken_curve_with_points(x : X, y : Y) : Draw forall X, Y

Draw a curve with points with given @p x and @p y vectors, breaking this curve whenever NaN is found in @p x or @p y.

Source
draw_contour(x : X, y : Y, z : Z) : Draw forall X, Y, Z

Draw contour lines from x, y, z data.

Source
draw_contour_filled(x : X, y : Y, z : Z) : Draw forall X, Y, Z

Draw filled contours from x, y, z data.

Source
draw_curve(name : String, xcol : String | Int32, ycol : String | Int32)

Draw a curve with given values at @p xcol and @p ycol columns in file @p name.

Source
draw_curve(x : X, y : Y) : Draw forall X, Y

Draw a curve with given @p x and @p y vectors.

Source
draw_curve_with_error_bars_x(name : String, xcol : String | Int32, ycol : String | Int32, xlowcol : String | Int32, xhighcol : String | Int32)

Draw a curve with error bars along x with given values at @p xcol, @p ycol, @p xlowcol, and @p xhighcol columns in file @p name.

Source
draw_curve_with_error_bars_x(name : String, xcol : String | Int32, ycol : String | Int32, xdeltacol : String | Int32)

Draw a curve with error bars along x with given values at @p xcol, @p ycol, and @p xdeltacol columns in file @p name.

Source
draw_curve_with_error_bars_x(x : X, y : Y, xlow : XL, xhigh : XH) : Draw forall X, Y, XL, XH

Draw a curve with error bars along x with given @p x, @p y, @p xlow, and @p xhigh vectors.

Source
draw_curve_with_error_bars_x(x : X, y : Y, xdelta : XD) : Draw forall X, Y, XD

Draw a curve with error bars along x with given @p x, @p y, and @p xdelta vectors.

Source
draw_curve_with_error_bars_xy(name : String, xcol : String | Int32, ycol : String | Int32, xlowcol : String | Int32, xhighcol : String | Int32, ylowcol : String | Int32, yhighcol : String | Int32)

Draw a curve with error bars along x and y with given values at @p xcol, @p ycol, @p xlowcol, @p xhighcol, @p ylowcol, and @p yhighcol columns in file @p name.

Source
draw_curve_with_error_bars_xy(x : X, y : Y, xlow : XL, xhigh : XH, ylow : YL, yhigh : YH) : Draw forall X, Y, XL, XH, YL, YH

Draw a curve with error bars along x and y with given @p x, @p y, @p xlow, @p xhigh, @p ylow, and @p yhigh vectors.

Source
draw_curve_with_error_bars_xy(name : String, xcol : String | Int32, ycol : String | Int32, xdeltacol : String | Int32, ydeltacol : String | Int32)

Draw a curve with error bars along x and y with given values at @p xcol, @p ycol, @p xdeltacol, and @p ydeltacol columns in file @p name.

Source
draw_curve_with_error_bars_xy(x : X, y : Y, xdelta : XD, ydelta : YD) : Draw forall X, Y, XD, YD

Draw a curve with error bars along x and y with given @p x, @p y, @p xdelta, and @p ydelta vectors.

Source
draw_curve_with_error_bars_y(name : String, xcol : String | Int32, ycol : String | Int32, ylowcol : String | Int32, yhighcol : String | Int32)

Draw a curve with error bars along y with given values at @p xcol, @p ycol, @p ylowcol, and @p yhighcol columns in file @p name.

Source
draw_curve_with_error_bars_y(name : String, xcol : String | Int32, ycol : String | Int32, ydeltacol : String | Int32)

Draw a curve with error bars along y with given values at @p xcol, @p ycol, and @p ydeltacol columns in file @p name.

Source
draw_curve_with_error_bars_y(x : X, y : Y, ylow : YL, yhigh : YH) : Draw forall X, Y, YL, YH

Draw a curve with error bars along y with given @p x, @p y, @p xlow, and @p xhigh vectors.

Source
draw_curve_with_error_bars_y(x : X, y : Y, ydelta : XD) : Draw forall X, Y, XD

Draw a curve with error bars along y with given @p x, @p y, and @p xdelta vectors.

Source
draw_curve_with_points(name : String, xcol : String | Int32, ycol : String | Int32)

Draw a curve with points with given values at @p xcol and @p ycol columns in file @p name.

Source
draw_curve_with_points(x : X, y : Y) : Draw forall X, Y

Draw a curve with points with given @p x and @p y vectors.

Source
draw_curve_with_points_y2(x : X, y : Y) : Draw forall X, Y

Draw a curve with points with given x and y vectors on the secondary y-axis (y2).

Source
draw_curve_y2(x : X, y : Y) : Draw forall X, Y

Draw a curve with given x and y vectors on the secondary y-axis (y2).

Source
draw_curves_filled(x : X, y1 : Y1, y2 : Y2) : Draw forall X, Y1, Y2

Draw curves with given @p x, @p y1 and @p y2 vectors with filled areas above / below / between curves.

Source
draw_curves_filled(x : X, y : Y) : Draw forall X, Y

Draw curves with given @p x and @p y vectors with filled areas above / below axes.

Source
draw_dots(name : String, xcol : String | Int32, ycol : String | Int32)

Draw dots with given values at @p xcol and @p ycol columns in file @p name.

Source
draw_dots(x, y)

Draw dots with given @p x and @p y vectors.

Source
draw_error_bars_x(name : String, xcol : String | Int32, ycol : String | Int32, xlowcol : String | Int32, xhighcol : String | Int32)

Draw error bars along x with given values at @p xcol, @p ycol, @p xlowcol, and @p xhighcol columns in file @p name.

Source
draw_error_bars_x(name : String, xcol : String | Int32, ycol : String | Int32, xdeltacol : String | Int32)

Draw error bars along x with given values at @p xcol, @p ycol, and @p xdeltacol columns in file @p name.

Source
draw_error_bars_x(x, y, xlow, xhigh)

Draw error bars along x with given @p x, @p y, @p xlow, and @p xhigh vectors.

Source
draw_error_bars_x(x, y, xdelta)

Draw error bars along x with given @p x, @p y, and @p xdelta vectors.

Source
draw_error_bars_xy(name : String, xcol : String | Int32, ycol : String | Int32, xlowcol : String | Int32, xhighcol : String | Int32, ylowcol : String | Int32, yhighcol : String | Int32)

Draw error bars along x and y with given values at @p xcol, @p ycol, @p xlowcol, @p xhighcol, @p ylowcol, and @p yhighcol columns in file @p name.

Source
draw_error_bars_xy(x, y, xlow, xhigh, ylow, yhigh)

Draw error bars along x and y with given @p x, @p y, @p xlow, @p xhigh, @p ylow, and @p yhigh vectors.

Source
draw_error_bars_xy(name : String, xcol : String | Int32, ycol : String | Int32, xdeltacol : String | Int32, ydeltacol : String | Int32)

Draw error bars along x and y with given values at @p xcol, @p ycol, @p xdeltacol, and @p ydeltacol columns in file @p name.

Source
draw_error_bars_xy(x, y, xdelta, ydelta)

Draw error bars along x and y with given @p x, @p y, @p xdelta, and @p ydelta vectors.

Source
draw_error_bars_y(name : String, xcol : String | Int32, ycol : String | Int32, ylowcol : String | Int32, yhighcol : String | Int32)

Draw error bars along y with given values at @p xcol, @p ycol, @p ylowcol, and @p yhighcol columns in file @p name.

Source
draw_error_bars_y(name : String, xcol : String | Int32, ycol : String | Int32, ydeltacol : String | Int32)

Draw error bars along y with given values at @p xcol, @p ycol, and @p ydeltacol columns in file @p name.

Source
draw_error_bars_y(x, y, ylow, yhigh)

Draw error bars along y with given @p x, @p y, @p ylow, and @p yhigh vectors.

Source
draw_error_bars_y(x, y, ydelta)

Draw error bars along y with given @p x, @p y, and @p ydelta vectors.

Source
draw_grouped_bars(categories : Array(String), series : Hash(String, Array(Float64)))

Draw grouped bar chart with categories and multiple series. categories: labels for x-axis series: hash of series_name => values

Source
draw_heatmap(x : X, y : Y, z : Z) : Draw forall X, Y, Z

Draw a heatmap with explicit x, y coordinates and z values.

Source
draw_heatmap(matrix : Array(Array(Float64)))

Draw a heatmap from a 2D matrix. The matrix should be an array of arrays where matrix[row][col] = value.

Source
draw_heatmap_labeled(matrix : Array(Array(Float64)), row_labels : Array(String), col_labels : Array(String), value_range : Tuple(Float64, Float64) | Nil = nil)

Draw a labeled heatmap from a 2D matrix with row and column labels. Useful for correlation matrices, confusion matrices, etc. matrix: 2D array where matrix[row][col] = value row_labels: labels for y-axis (rows) col_labels: labels for x-axis (columns) value_range: optional tuple {min, max} for color scale (e.g., {-1.0, 1.0} for correlation)

Source
draw_histogram(name : String, ycol : String | Int32)

Draw a histogram with given values at @p ycol column in file @p name.

Source
draw_histogram(y)

Draw a histogram for the given @p y vector.

Source
draw_impulses(name : String, xcol : String | Int32, ycol : String | Int32)

Draw impulses with given values at @p xcol and @p ycol columns in file @p name.

Source
draw_impulses(x, y)

Draw impulses with given @p x and @p y vectors.

Source
draw_points(name : String, xcol : String | Int32, ycol : String | Int32)

Draw points with given values at @p xcol and @p ycol columns in file @p name.

Source
draw_points(x, y)

Draw points with given @p x and @p y vectors.

Source
draw_points_y2(x : X, y : Y) : Draw forall X, Y

Draw points with given x and y vectors on the secondary y-axis (y2).

Source
draw_scatter(x : X, y : Y) : Draw forall X, Y

Draw a scatter plot with given x and y vectors. This is an alias for draw_points but with a more intuitive name.

Source
draw_scatter_color(x : X, y : Y, color : C) : Draw forall X, Y, C

Draw a scatter plot with color mapping based on a third variable. The color values determine the color of each point using the current palette.

Source
draw_scatter_color_size(x : X, y : Y, color : C, size : S) : Draw forall X, Y, C, S

Draw a scatter plot with both color and size mapping. Color is mapped to the third column, size to the fourth.

Source
draw_scatter_size(x : X, y : Y, size : S) : Draw forall X, Y, S

Draw a scatter plot with size mapping based on a third variable. The size values determine the size of each point.

Source
draw_stacked_bars(categories : Array(String), series : Hash(String, Array(Float64)))

Draw stacked bar chart with categories and multiple series.

Source
draw_steps(name : String, xcol : String | Int32, ycol : String | Int32)

Draw steps with given values at @p xcol and @p ycol columns in file @p name. Identical to @ref drawStepsChangeFirstX.

Source
draw_steps(x, y)

Draw steps with given @p x and @p y vectors. Identical to @ref drawStepsChangeFirstX.

Source
draw_steps_change_first_x(name : String, xcol : String | Int32, ycol : String | Int32)

Draw steps with given values at @p xcol and @p ycol columns in file @p name with steps along x changes first.

Source
draw_steps_change_first_x(x, y)

Draw steps with given @p x and @p y vectors with steps along x changes first.

Source
draw_steps_change_first_y(name : String, xcol : String | Int32, ycol : String | Int32)

Draw steps with given values at @p xcol and @p ycol columns in file @p name with steps along y changes first.

Source
draw_steps_change_first_y(x, y)

Draw steps with given @p x and @p y vectors with steps along y changes first.

Source
draw_steps_filled(name : String, xcol : String | Int32, ycol : String | Int32)

Draw steps with given values at @p xcol and @p ycol columns in file @p name with filled area below steps.

Source
draw_steps_filled(x, y)

Draw steps with given @p x and @p y vectors with filled area below steps.

Source
draw_steps_histogram(name : String, xcol : String | Int32, ycol : String | Int32)

Draw steps with given values at @p xcol and @p ycol columns in file @p name in a histogram style

Source
draw_steps_histogram(x, y)

Draw steps with given @p x and @p y vectors in a histogram style

Source
draw_with_cols(name : String, with_ : String, cols : Array(String | Int32))

Draw plot object with given style and given vectors (e.g., plot.draw("lines", x, y)).

Source
draw_with_vecs(with_ : String, x : X, *vecs : Array) : Draw forall X

Draw plot object with given style and given vectors (e.g., plot.draw("lines", x, y)).

Source
draw_with_vecs_containing_nan(with_ : String, x : X, *vecs : Array) : Draw forall X

Draw plot object with given style and given vectors (e.g., plot.draw("lines", x, y)) that may contain NaN values.

Source
heatmap_palette(style : Symbol)

Set the color palette for heatmaps. Predefined options: :diverging (red-white-green), :sequential (white-blue), :thermal (black-red-yellow-white)

Source
hline(y : Number, options : String = "")

Add a horizontal line at the specified y value.

Source
repr
Source
rtics

Return the specifications of the grid lines along major rtics.

Source
rtics_major

Return the specifications of the grid lines along minor rtics.

Source
rtics_minor

Return the specifications of the grid lines along minor rtics.

Source
style_histogram

an object that permits histogram style to be customized.

Source
tics

tics of the plot and return a reference to the corresponding specs object.

Source
to_s(io : IO) : Nil

convert this plot object into a gnuplot formatted string.

Source
vline(x : Number, options : String = "")

Add a vertical line at the specified x value.

Source
xlabel(label : String)

Set the label of the x-axis and return a reference to the corresponding specs object.

Source
xlog(base : Int32 = 10)

Set the x-axis to logarithmic scale.

Source
xlog_off

Disable logarithmic scale on x-axis.

Source
xrange(min : StringOrFloat, max : StringOrFloat)

Set the x-range of the plot (also possible with empty values or autoscale options (e.g. "", "*")).

Source
xtics

Return the specifications of the grid lines along major xtics on the bottom axis.

Source
xtics_major_bottom

Return the specifications of the grid lines along major xtics on the bottom axis.

Source
xtics_major_top

Return the specifications of the grid lines along major xtics on the top axis.

Source
xtics_minor_bottom

Return the specifications of the grid lines along minor xtics on the bottom axis.

Source
xtics_minor_top

Return the specifications of the grid lines along minor xtics on the top axis.

Source
xtime_display(format : String)

Set the display format for x-axis time labels. The format string uses strftime format specifiers.

Source
xtime_format(format : String)

Set the x-axis to use time/date format. The format string uses strftime format specifiers (e.g., "%Y-%m-%d", "%H:%M:%S").

Source
xylog(base : Int32 = 10)

Set both x and y axes to logarithmic scale.

Source
y2label(label : String)

Set the label of the secondary y-axis (y2) and return a reference to the corresponding specs object.

Source
y2range(min : StringOrFloat, max : StringOrFloat)

Set the y2-range of the plot (also possible with empty values or autoscale options (e.g. "", "*")).

Source
y2tics_show

Enable the secondary y-axis (y2) tics.

Source
ylabel(label : String)

Set the label of the y-axis and return a reference to the corresponding specs object.

Source
ylog(base : Int32 = 10)

Set the y-axis to logarithmic scale.

Source
ylog_off

Disable logarithmic scale on y-axis.

Source
yrange(min : StringOrFloat, max : StringOrFloat)

Set the y-range of the plot (also possible with empty values or autoscale options (e.g. "", "*")).

Source
ytics

Return the specifications of the grid lines along major ytics on the left axis.

Source
ytics_major_left

Return the specifications of the grid lines along major ytics on the left axis.

Source
ytics_major_right

Return the specifications of the grid lines along major ytics on the right axis.

Source
ytics_minor_left

Return the specifications of the grid lines along minor ytics on the left axis.

Source
ytics_minor_right

Return the specifications of the grid lines along minor ytics on the right axis.

Source
ytime_display(format : String)

Set the display format for y-axis time labels.

Source
ytime_format(format : String)

Set the y-axis to use time/date format.

Source
ztics

Return the specifications of the grid lines along major ztics.

Source
ztics_major

Return the specifications of the grid lines along major ztics.

Source
ztics_minor

Return the specifications of the grid lines along minor ztics.

Source