Skip to content

Latest commit

 

History

History
91 lines (63 loc) · 2.85 KB

README.md

File metadata and controls

91 lines (63 loc) · 2.85 KB

rubyplot

An advanced plotting library for Ruby.

Rubyplot aims to be the most advanced visualization solution for Rubyists.

It aims to allow you to visualize anything, anywhere with a flexible, extensible, Ruby-like API.

Backends

Rubyplot can use different backends to render its plots:

  • magick Using ImageMagick
  • gr Using the GR framework
  • tk_canvas Interactive drawing in a Canvas object using Ruby/Tk

Call Rubyplot.set_backend at the start of your program to select the desired backend.

Pick the desired one:

Rubyplot.set_backend(:magick)
Rubyplot.set_backend(:gr)
Rubyplot.set_backend(:tk_canvas)

Installing GR

Install the GR framework from the website.

Then set the GRDIR and GKS_FONTPATH ENV variables to point to your GR installation and GR font path. Set the RUBYPLOT_BACKEND ENV variable to "GR". For example:

export GRDIR="/home/sameer/Downloads/gr"
export GKS_FONTPATH="/home/sameer/Downloads/gr"
export RUBYPLOT_BACKEND="GR"

Installing Tk

This gem is not including tk in its dependencies so you don't have to install it if you're not going to use the tk_canvas backend.

If you will need to use this backend, you will need to add a reference to tk in your Gemfile in addition to referring to rubyplot.

gem 'tk'

Running bundle install after this change will install it.

In addition to install the tk gem in your project, you need to install the Tcl/Tk runtime in your system. The instructions depending on the OS but it is a safe bet to install the Community Edition of Active Tcl from https://www.activestate.com/

You have more details about installing Tk in different systems in the excelent TkDocs website.

If you want to have a more modern way of interacting with Tk from Ruby, you can use TkComponent and TkInspect.

Examples

See the examples to see some how-to code.

Short term priorities

Check milestones in GitHub for more information.

Long term vision

Rubyplot's long term vision, by priority:

  • Integrate the Rubyplot interface with the GR framework.
  • Generate various types of publication quality plots.
  • Interactive plotting using QT/GTK.
  • Integrate with bokehjs (or some other web framework) for plotting in the web browser.

Release cycle

The library is currently in alpha stage. Version 0.1.0 is designated to be the first 'final' release. Until then we will utilize various numbering schemes in the third position of the version number to denote alpha, beta and RC releases. They are as follows:

  • a for alpha. For example 0.1-a1 is the first alpha release.
  • b for beta. For example 0.1-b1 is the first beta release.
  • rc for RC. For example 0.1-rc1 is the first RC release.