• Stars
    star
    245
  • Rank 159,088 (Top 4 %)
  • Language
    Ruby
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 11 months ago

Reviews 5.0 (1)

7 months ago by Igor Kasyanchuk

Wonderful library, a really cool project that allows you to build simple charts in console apps.

Repository Details

Plot your data by Unicode characters

UnicodePlot - Plot your data by Unicode characters

UnicodePlot provides the feature to make charts with Unicode characters.

Documentation

https://red-data-tools.github.io/unicode_plot.rb/

Install

$ gem install unicode_plot

Usage

require 'unicode_plot'

x = 0.step(3*Math::PI, by: 3*Math::PI / 30)
y_sin = x.map {|xi| Math.sin(xi) }
y_cos = x.map {|xi| Math.cos(xi) }
plot = UnicodePlot.lineplot(x, y_sin, name: "sin(x)", width: 40, height: 10)
UnicodePlot.lineplot!(plot, x, y_cos, name: "cos(x)")
plot.render

You can get the results below by running the above script:

Supported charts

barplot

UnicodePlot.barplot(data: {'foo': 20, 'bar': 50}, title: "Bar").render

boxplot

UnicodePlot.boxplot(data: {foo: [1, 3, 5], bar: [3, 5, 7]}, title: "Box").render

densityplot

x = Array.new(500) { 20*rand - 10 } + Array.new(500) { 6*rand - 3 }
y = Array.new(1000) { 30*rand - 10 }
UnicodePlot.densityplot(x, y, title: "Density").render

histogram

x = Array.new(100) { rand(10) } + Array.new(100) { rand(30) + 10 }
UnicodePlot.histogram(x, title: "Histogram").render

lineplot

See Usage section above.

scatterplot

x = Array.new(50) { rand(20) - 10 }
y = x.map {|xx| xx*rand(30) - 10 }
UnicodePlot.scatterplot(x, y, title: "Scatter").render

Acknowledgement

This library is strongly inspired by UnicodePlot.jl.

License

MIT License

Author

More Repositories

1

YouPlot

A command line tool that draw plots on the terminal.
Ruby
3,885
star
2

charty

Visualizing your data in Ruby
Ruby
190
star
3

jekyll-jupyter-notebook

Jekyll Jupyter Notebook plugin
Ruby
159
star
4

red-chainer

A flexible framework for neural network for Ruby
Ruby
103
star
5

GR.rb

Ruby wrapper for the GR framework
Ruby
91
star
6

red_amber

A dataframe library for Rubyists.
Ruby
59
star
7

red-arrow

Ruby bindings for Apache Arrow based on GObject Introspection
Ruby
52
star
8

red-datasets

A RubyGem that provides common datasets
Ruby
30
star
9

extpp

C++ Ruby extension API
C++
20
star
10

packages.red-data-tools.org

The source of packages.red-data-tools.org
Ruby
13
star
11

red-arrow-duckdb

A library that provides Apache Arrow support to ruby-duckdb
C++
10
star
12

parquet-glib

GLib wrapper library of Apache Parquet
C++
9
star
13

red-parquet

Ruby bindings for Apache Parquet based on GObject Introspection
Ruby
7
star
14

red-opencv

Ruby bindings for OpenCL based on GObject Introspection
Ruby
6
star
15

red-optuna

Ruby bindings for Optuna, a hyperparameter optimization framework
Ruby
5
star
16

activerecord-duckdb-adapter

Ruby
5
star
17

red-datasets-arrow

A Red Datasets plugin to export dataset as Apache Arrow object
Ruby
5
star
18

red-arrow-activerecord

A library that provides conversion method between Apache Arrow and Active Record
Ruby
5
star
19

red-colors

Color features for Ruby
Ruby
4
star
20

red-arrow-nmatrix

A library that provides conversion method between Apache Arrow and NMatrix
Ruby
3
star
21

xtensor-arrow-glib

GLib wrapper library of xtensor for Apache Arrow
C++
3
star
22

opencv-glib

GLib bindings for OpenCV
C++
3
star
23

red-arrow-numo-narray

A library that provides conversion method between Apache Arrow and Numo::NArray
Ruby
3
star
24

red-table-query

Universal query interface for table data
Ruby
3
star
25

activerecord-adbc-adapter

ADBC based Active Record adapter
Ruby
3
star
26

red-datasets-numo-narray

A Red Datasets plugin to export dataset as Numo::NArray object
Ruby
3
star
27

red-arrow-pycall

A library that provides conversion method between Apache Arrow and PyCall
Ruby
3
star
28

dlib-glib

GLib bindings for Dlib
C++
2
star
29

fluent-plugin-s3-arrow

Extends the fluent-plugin-s3 compression algorithm to enable red-arrow compression.
Ruby
2
star
30

red-datasets-parquet

A Red Datasets plugin to process datasets provided as Apache Parquet format
Ruby
2
star
31

red-datasets-gdk-pixbuf

A Red Datasets plugin to export dataset as GdkPixbuf::Pixbuf object
Ruby
2
star
32

red-float

Float32 and Float16 for Ruby
C
1
star
33

red-arrow-gsl

A library that provides conversion method between Apache Arrow and Ruby/GSL
Ruby
1
star
34

charty-backends-jfreechart

Charty JFreeChart backend adapter
Ruby
1
star
35

red-datasets-daru

A Red Datasets plugin to export dataset as Daru::DataFrame object
Ruby
1
star
36

gr-plot

A simple, matlab-style API for GR.rb
Ruby
1
star
37

events

Repository for Red Data Tools related events
1
star
38

red-data-tools.github.io

The Red Data Tools project site
SCSS
1
star
39

red-data-reader

Ruby library to read data
Ruby
1
star
40

red-arrow-gpu

Ruby bindings for Apache Arrow GPU based on GObject Introspection
Ruby
1
star
41

activerecord-arrow-adapters

Connection adapters using Apache Arrow internally
Ruby
1
star