Gem Version Dependency Status Build Status Test Coverage Code Climate


Rbplotly, a Ruby visualization library, allows you to create interactive plots.


Add this line to your application's Gemfile:

gem 'rbplotly'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rbplotly


require 'rbplotly'

x = [0, 1, 2, 3, 4]
trace0 = { x: x, y: [0, 2, 1, 4, 3], type: :scatter, mode: :lines }
trace1 = { x: x, y: [4, 1, 3, 0, 2], type: :scatter, mode: :'markers+lines' }
data = [trace0, trace1] # data must be an array

layout = { width: 500, height: 500 }

plot = data, layout: layout)

plot.layout.height = 300 # You can assign plot's attributes.

plot.generate_html(path: './line_chart.html')

Use #download_image if you want to get an image by using API. You can get your API KEY here.

plot.download_image(path: './line_chart.png')

Or use #show on IRuby notebooks.


Visit here to see more examples.


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request


rbplotly is based on plotly/, so there are a lot of code coming from it.


Copyright (c) 2016 Yoshihiro Ashida. See LICENSE.txt for further details.