GnuplotRB
GnuplotRB is a plot generator for Ruby based on Gnuplot.
This software has been developed as a product in Google Summer of Code 2015 (GSoC2015). Its progress may be saw in SciRuby mailing list or in project’s blog.
<img src=“badge.fury.io/rb/gnuplotrb.svg” alt=“Gem Version” />
<img src=“travis-ci.org/dilcom/gnuplotrb.svg?branch=master” alt=“Build Status” /> <img src=“codeclimate.com/github/dilcom/gnuplotrb/badges/gpa.svg” alt=“Code quality” /> <img src=“codeclimate.com/github/dilcom/gnuplotrb/badges/coverage.svg” alt=“Test coverage” />
Table of contents
Installation
Dependencies
-
Ruby 2.0+
-
It is required to install gnuplot 5.0 to use that gem.
Gem installation
Install latest stable version from Rubygems
gem install gnuplotrb
Install latest stable version using bundler
-
add
gem 'gnuplotrb'to your Gemfile
-
run
bundle install
Install latest version from source (may be unstable)
git clone https://github.com/dilcom/gnuplotrb.git
cd gnuplotrb
bundle install
rake install
Examples
Notebooks
This notebooks are powered by Ruby kernel for IPython/Jupyter. I placed them here to show some GnuplotRB’s capabilities and ways of using it together with iRuby.
To use GnuplotRB gem with iRuby you need to install them both.
-
iRuby installation is covered in its README. It also covers installation of iPython and other dependecies.
-
GnuplotRB gem installation covered in README too.
Embedding plots into iRuby
Using GnuplotRB inside iRuby notebooks is covered in:
2D and 3D plots
GnuplotRB is capable to plot vast range of plots from histograms to 3D heatmaps. Gem’s repository contains examples of several plot types:
Possible datasources
GnuplotRB may take data in Ruby container or in a file. Supported containers for now are Arrays, Daru::Vector and Daru::DataFrame. When data given in file, GnuplotRB pass filename to Gnuplot without reading the file into memory.
Examples of using different datasources:
Multiplot
You can not only plot several datasets in single coordinate system but place several coordinate systems on a canvas.
Animation
It’s possible to use several plots (Plot, Splot or Multiplot objects) to create gif animation.
Fitting data with formula
GnuplotRB also may be used to fit some data with given math formula.
Plain examples
You may find several examples in examples directory.
Contributing
-
Create your feature branch (‘git checkout -b my-new-feature`)
-
Commit your changes (‘git commit -am ’Add some feature’‘)
-
Push to the branch (‘git push origin my-new-feature`)
-
Create a new Pull Request