Hi, first week of GSOC 2015 is over and in this post I want to explain what progress I had and provide you some thoughts about my objectives for the next week.
GnuplotRB gem already may be used to plot some 2D graphs. It can plot math functions, data given in file or in Ruby Array. You may plot in cartesian or polar coordinates and set functions with parametric formulas.
I think examples from repository are more informative. Most of them are used to test gnuplot gem in specs so you may be sure they work since Travis CI builds are successful.
Plotting data from existing file
When you need to plot data from file you should not read it and them pass to gem as data. All you need is to pass file name. In this case file is not read by Ruby and piped out to Gnuplot. Only its name piped out to Gnuplot. And Gnuplot takes care of reading and plotting itself. Plotting from datafiles with gnuplot gem works as fast as with Gnuplot itself.
More information and samples of that case may be found in mailing list.
Installation (variant used during development)
- Ruby 2.0.0+
- Gnuplot 5.0+
How to install with Gemfile
- create Gemfile with following contents
source 'https://rubygems.org' gem 'gnuplotrb', :git => 'https://github.com/dilcom/gnuplotrb.git'
- run 'bundle install' in directory with Gemfile
How to install without creating Gemfile
Run following commands:
git clone https://github.com/dilcom/gnuplotrb.git cd gnuplotrb bundle install rake install
require 'gnuplotrb' include GnuplotRB # see examples
Objectives for this week
This week I'm going to focus on trying to use Daru for storage data in memory. I will also need to write specs for Datablock and Plot. And finally I'm going to share the gem and samples with community to recieve feedbacks and make gem better.