rbplotly 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -42,11 +42,12 @@
42
42
  }
43
43
  ],
44
44
  "source": [
45
+ "# Basic Histogram\n",
45
46
  "require 'rbplotly'\n",
46
47
  "\n",
47
- "data = { x: (1..500).map { rand }, type: 'histogram' }\n",
48
+ "data = [{ x: (1..500).map { rand }, type: :histogram }]\n",
48
49
  "\n",
49
- "plot = Plotly::Plot.new(data: [data])\n",
50
+ "plot = Plotly::Plot.new(data: data)\n",
50
51
  "plot.show"
51
52
  ]
52
53
  },
@@ -0,0 +1,88 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "metadata": {
7
+ "collapsed": false
8
+ },
9
+ "outputs": [
10
+ {
11
+ "data": {
12
+ "text/html": [
13
+ "\n",
14
+ " <script>\n",
15
+ " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
16
+ " </script>\n",
17
+ "\n",
18
+ "\n",
19
+ "<div id=\"52d2f3bb-398d-4297-9a0e-482a9f2b5201\" style=\"height: 100%; width: 100%;\"></div>\n",
20
+ "\n",
21
+ "<script>\n",
22
+ " require(['plotly'], function(Plotly) { \n",
23
+ "Plotly.newPlot(\n",
24
+ " '52d2f3bb-398d-4297-9a0e-482a9f2b5201',\n",
25
+ " [{\"x\":[0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,4.0,4.1,4.2,4.3,4.4,4.5,4.6,4.7,4.8,4.9,5.0,5.1,5.2,5.3,5.4,5.5,5.6,5.7,5.8,5.9,6.0,6.1,6.2,6.3,6.4,6.5,6.6,6.7,6.8,6.9,7.0,7.1,7.2,7.3,7.4,7.5,7.6,7.7,7.8,7.9,8.0,8.1,8.2,8.3,8.4,8.5,8.6,8.7,8.8,8.9,9.0,9.1,9.2,9.3,9.4,9.5,9.6,9.7,9.8,9.9],\"y\":[0.09983341664682815,0.19866933079506122,0.29552020666133955,0.3894183423086505,0.479425538604203,0.5646424733950354,0.644217687237691,0.7173560908995228,0.7833269096274833,0.8414709848078965,0.8912073600614354,0.9320390859672263,0.963558185417193,0.9854497299884601,0.9974949866040544,0.9995736030415051,0.9916648104524686,0.9738476308781951,0.9463000876874145,0.9092974268256817,0.8632093666488738,0.8084964038195901,0.7457052121767203,0.675463180551151,0.5984721441039564,0.5155013718214642,0.4273798802338298,0.33498815015590505,0.2392493292139824,0.1411200080598672,0.04158066243329049,-0.058374143427580086,-0.1577456941432482,-0.2555411020268312,-0.35078322768961984,-0.44252044329485246,-0.5298361409084934,-0.6118578909427189,-0.6877661591839738,-0.7568024953079282,-0.8182771110644103,-0.8715757724135881,-0.9161659367494549,-0.9516020738895161,-0.977530117665097,-0.9936910036334644,-0.9999232575641008,-0.9961646088358407,-0.9824526126243325,-0.9589242746631385,-0.9258146823277325,-0.8834546557201531,-0.8322674422239013,-0.7727644875559871,-0.7055403255703919,-0.6312666378723216,-0.5506855425976376,-0.46460217941375737,-0.373876664830236,-0.27941549819892586,-0.1821625042720959,-0.08308940281749641,0.016813900484349713,0.11654920485049364,0.21511998808781552,0.31154136351337786,0.40484992061659836,0.4941133511386082,0.5784397643882002,0.6569865987187891,0.7289690401258759,0.7936678638491531,0.8504366206285644,0.8987080958116269,0.9379999767747389,0.9679196720314863,0.9881682338770004,0.998543345374605,0.998941341839772,0.9893582466233818,0.9698898108450863,0.9407305566797731,0.9021718337562934,0.8545989080882805,0.7984871126234903,0.7343970978741134,0.6629692300821833,0.5849171928917617,0.5010208564578846,0.4121184852417566,0.3190983623493521,0.22288991410024764,0.12445442350706169,0.024775425453357765,-0.07515112046180931,-0.17432678122297965,-0.2717606264109424,-0.3664791292519284,-0.45753589377532133],\"line\":{\"shape\":\"spline\"},\"mode\":\"lines\"},{\"x\":[0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,4.0,4.1,4.2,4.3,4.4,4.5,4.6,4.7,4.8,4.9,5.0,5.1,5.2,5.3,5.4,5.5,5.6,5.7,5.8,5.9,6.0,6.1,6.2,6.3,6.4,6.5,6.6,6.7,6.8,6.9,7.0,7.1,7.2,7.3,7.4,7.5,7.6,7.7,7.8,7.9,8.0,8.1,8.2,8.3,8.4,8.5,8.6,8.7,8.8,8.9,9.0,9.1,9.2,9.3,9.4,9.5,9.6,9.7,9.8,9.9],\"y\":[0.8912073600614354,0.9320390859672263,0.963558185417193,0.9854497299884601,0.9974949866040544,0.9995736030415051,0.9916648104524686,0.9738476308781951,0.9463000876874145,0.9092974268256817,0.8632093666488738,0.8084964038195901,0.7457052121767203,0.675463180551151,0.5984721441039564,0.5155013718214642,0.4273798802338298,0.33498815015590505,0.2392493292139824,0.1411200080598672,0.04158066243329049,-0.058374143427580086,-0.1577456941432482,-0.2555411020268312,-0.35078322768961984,-0.44252044329485246,-0.5298361409084934,-0.6118578909427189,-0.6877661591839738,-0.7568024953079282,-0.8182771110644103,-0.8715757724135881,-0.9161659367494549,-0.9516020738895161,-0.977530117665097,-0.9936910036334644,-0.9999232575641008,-0.9961646088358407,-0.9824526126243325,-0.9589242746631385,-0.9258146823277325,-0.8834546557201531,-0.8322674422239013,-0.7727644875559871,-0.7055403255703919,-0.6312666378723216,-0.5506855425976376,-0.46460217941375737,-0.373876664830236,-0.27941549819892586,-0.1821625042720959,-0.08308940281749641,0.016813900484349713,0.11654920485049364,0.21511998808781552,0.31154136351337786,0.40484992061659836,0.4941133511386082,0.5784397643882002,0.6569865987187891,0.7289690401258759,0.7936678638491531,0.8504366206285644,0.8987080958116269,0.9379999767747389,0.9679196720314863,0.9881682338770004,0.998543345374605,0.998941341839772,0.9893582466233818,0.9698898108450863,0.9407305566797731,0.9021718337562934,0.8545989080882805,0.7984871126234903,0.7343970978741134,0.6629692300821833,0.5849171928917617,0.5010208564578846,0.4121184852417566,0.3190983623493521,0.22288991410024764,0.12445442350706169,0.024775425453357765,-0.07515112046180931,-0.17432678122297965,-0.2717606264109424,-0.3664791292519284,-0.45753589377532133,-0.5440211108893699,-0.6250706488928821,-0.6998746875935424,-0.7676858097635825,-0.8278264690856536,-0.87969575997167,-0.9227754216128066,-0.9566350162701879,-0.9809362300664916,-0.9954362533063774],\"line\":{\"shape\":\"spline\"},\"mode\":\"lines\"},{\"x\":[0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,4.0,4.1,4.2,4.3,4.4,4.5,4.6,4.7,4.8,4.9,5.0,5.1,5.2,5.3,5.4,5.5,5.6,5.7,5.8,5.9,6.0,6.1,6.2,6.3,6.4,6.5,6.6,6.7,6.8,6.9,7.0,7.1,7.2,7.3,7.4,7.5,7.6,7.7,7.8,7.9,8.0,8.1,8.2,8.3,8.4,8.5,8.6,8.7,8.8,8.9,9.0,9.1,9.2,9.3,9.4,9.5,9.6,9.7,9.8,9.9],\"y\":[0.8632093666488738,0.8084964038195901,0.7457052121767203,0.675463180551151,0.5984721441039564,0.5155013718214642,0.4273798802338298,0.33498815015590505,0.2392493292139824,0.1411200080598672,0.04158066243329049,-0.058374143427580086,-0.1577456941432482,-0.2555411020268312,-0.35078322768961984,-0.44252044329485246,-0.5298361409084934,-0.6118578909427189,-0.6877661591839738,-0.7568024953079282,-0.8182771110644103,-0.8715757724135881,-0.9161659367494549,-0.9516020738895161,-0.977530117665097,-0.9936910036334644,-0.9999232575641008,-0.9961646088358407,-0.9824526126243325,-0.9589242746631385,-0.9258146823277325,-0.8834546557201531,-0.8322674422239013,-0.7727644875559871,-0.7055403255703919,-0.6312666378723216,-0.5506855425976376,-0.46460217941375737,-0.373876664830236,-0.27941549819892586,-0.1821625042720959,-0.08308940281749641,0.016813900484349713,0.11654920485049364,0.21511998808781552,0.31154136351337786,0.40484992061659836,0.4941133511386082,0.5784397643882002,0.6569865987187891,0.7289690401258759,0.7936678638491531,0.8504366206285644,0.8987080958116269,0.9379999767747389,0.9679196720314863,0.9881682338770004,0.998543345374605,0.998941341839772,0.9893582466233818,0.9698898108450863,0.9407305566797731,0.9021718337562934,0.8545989080882805,0.7984871126234903,0.7343970978741134,0.6629692300821833,0.5849171928917617,0.5010208564578846,0.4121184852417566,0.3190983623493521,0.22288991410024764,0.12445442350706169,0.024775425453357765,-0.07515112046180931,-0.17432678122297965,-0.2717606264109424,-0.3664791292519284,-0.45753589377532133,-0.5440211108893699,-0.6250706488928821,-0.6998746875935424,-0.7676858097635825,-0.8278264690856536,-0.87969575997167,-0.9227754216128066,-0.9566350162701879,-0.9809362300664916,-0.9954362533063774,-0.9999902065507035,-0.9945525882039892,-0.9791777291513174,-0.954019249902089,-0.9193285256646757,-0.8754521746884285,-0.8228285949687089,-0.7619835839190333,-0.6935250847771224,-0.6181371122370333],\"line\":{\"shape\":\"spline\"},\"mode\":\"lines\"},{\"x\":[0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,4.0,4.1,4.2,4.3,4.4,4.5,4.6,4.7,4.8,4.9,5.0,5.1,5.2,5.3,5.4,5.5,5.6,5.7,5.8,5.9,6.0,6.1,6.2,6.3,6.4,6.5,6.6,6.7,6.8,6.9,7.0,7.1,7.2,7.3,7.4,7.5,7.6,7.7,7.8,7.9,8.0,8.1,8.2,8.3,8.4,8.5,8.6,8.7,8.8,8.9,9.0,9.1,9.2,9.3,9.4,9.5,9.6,9.7,9.8,9.9],\"y\":[0.04158066243329049,-0.058374143427580086,-0.1577456941432482,-0.2555411020268312,-0.35078322768961984,-0.44252044329485246,-0.5298361409084934,-0.6118578909427189,-0.6877661591839738,-0.7568024953079282,-0.8182771110644103,-0.8715757724135881,-0.9161659367494549,-0.9516020738895161,-0.977530117665097,-0.9936910036334644,-0.9999232575641008,-0.9961646088358407,-0.9824526126243325,-0.9589242746631385,-0.9258146823277325,-0.8834546557201531,-0.8322674422239013,-0.7727644875559871,-0.7055403255703919,-0.6312666378723216,-0.5506855425976376,-0.46460217941375737,-0.373876664830236,-0.27941549819892586,-0.1821625042720959,-0.08308940281749641,0.016813900484349713,0.11654920485049364,0.21511998808781552,0.31154136351337786,0.40484992061659836,0.4941133511386082,0.5784397643882002,0.6569865987187891,0.7289690401258759,0.7936678638491531,0.8504366206285644,0.8987080958116269,0.9379999767747389,0.9679196720314863,0.9881682338770004,0.998543345374605,0.998941341839772,0.9893582466233818,0.9698898108450863,0.9407305566797731,0.9021718337562934,0.8545989080882805,0.7984871126234903,0.7343970978741134,0.6629692300821833,0.5849171928917617,0.5010208564578846,0.4121184852417566,0.3190983623493521,0.22288991410024764,0.12445442350706169,0.024775425453357765,-0.07515112046180931,-0.17432678122297965,-0.2717606264109424,-0.3664791292519284,-0.45753589377532133,-0.5440211108893699,-0.6250706488928821,-0.6998746875935424,-0.7676858097635825,-0.8278264690856536,-0.87969575997167,-0.9227754216128066,-0.9566350162701879,-0.9809362300664916,-0.9954362533063774,-0.9999902065507035,-0.9945525882039892,-0.9791777291513174,-0.954019249902089,-0.9193285256646757,-0.8754521746884285,-0.8228285949687089,-0.7619835839190333,-0.6935250847771224,-0.6181371122370333,-0.5365729180004349,-0.44964746453460147,-0.3582292822368287,-0.263231791365801,-0.1656041754483094,-0.06632189735120068,0.03362304722113669,0.13323204141994222,0.23150982510153895,0.32747443913769303],\"line\":{\"shape\":\"spline\"},\"mode\":\"lines\"},{\"x\":[0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,4.0,4.1,4.2,4.3,4.4,4.5,4.6,4.7,4.8,4.9,5.0,5.1,5.2,5.3,5.4,5.5,5.6,5.7,5.8,5.9,6.0,6.1,6.2,6.3,6.4,6.5,6.6,6.7,6.8,6.9,7.0,7.1,7.2,7.3,7.4,7.5,7.6,7.7,7.8,7.9,8.0,8.1,8.2,8.3,8.4,8.5,8.6,8.7,8.8,8.9,9.0,9.1,9.2,9.3,9.4,9.5,9.6,9.7,9.8,9.9],\"y\":[-0.8182771110644103,-0.8715757724135881,-0.9161659367494549,-0.9516020738895161,-0.977530117665097,-0.9936910036334644,-0.9999232575641008,-0.9961646088358407,-0.9824526126243325,-0.9589242746631385,-0.9258146823277325,-0.8834546557201531,-0.8322674422239013,-0.7727644875559871,-0.7055403255703919,-0.6312666378723216,-0.5506855425976376,-0.46460217941375737,-0.373876664830236,-0.27941549819892586,-0.1821625042720959,-0.08308940281749641,0.016813900484349713,0.11654920485049364,0.21511998808781552,0.31154136351337786,0.40484992061659836,0.4941133511386082,0.5784397643882002,0.6569865987187891,0.7289690401258759,0.7936678638491531,0.8504366206285644,0.8987080958116269,0.9379999767747389,0.9679196720314863,0.9881682338770004,0.998543345374605,0.998941341839772,0.9893582466233818,0.9698898108450863,0.9407305566797731,0.9021718337562934,0.8545989080882805,0.7984871126234903,0.7343970978741134,0.6629692300821833,0.5849171928917617,0.5010208564578846,0.4121184852417566,0.3190983623493521,0.22288991410024764,0.12445442350706169,0.024775425453357765,-0.07515112046180931,-0.17432678122297965,-0.2717606264109424,-0.3664791292519284,-0.45753589377532133,-0.5440211108893699,-0.6250706488928821,-0.6998746875935424,-0.7676858097635825,-0.8278264690856536,-0.87969575997167,-0.9227754216128066,-0.9566350162701879,-0.9809362300664916,-0.9954362533063774,-0.9999902065507035,-0.9945525882039892,-0.9791777291513174,-0.954019249902089,-0.9193285256646757,-0.8754521746884285,-0.8228285949687089,-0.7619835839190333,-0.6935250847771224,-0.6181371122370333,-0.5365729180004349,-0.44964746453460147,-0.3582292822368287,-0.263231791365801,-0.1656041754483094,-0.06632189735120068,0.03362304722113669,0.13323204141994222,0.23150982510153895,0.32747443913769303,0.4201670368266409,0.5086614643723737,0.592073514707223,0.6695697621966024,0.7403758899524486,0.803784426551621,0.8591618148564959,0.9059547423084618,0.9436956694441048,0.9720075013949759],\"line\":{\"shape\":\"spline\"},\"mode\":\"lines\"},{\"x\":[0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,4.0,4.1,4.2,4.3,4.4,4.5,4.6,4.7,4.8,4.9,5.0,5.1,5.2,5.3,5.4,5.5,5.6,5.7,5.8,5.9,6.0,6.1,6.2,6.3,6.4,6.5,6.6,6.7,6.8,6.9,7.0,7.1,7.2,7.3,7.4,7.5,7.6,7.7,7.8,7.9,8.0,8.1,8.2,8.3,8.4,8.5,8.6,8.7,8.8,8.9,9.0,9.1,9.2,9.3,9.4,9.5,9.6,9.7,9.8,9.9],\"y\":[-0.9258146823277325,-0.8834546557201531,-0.8322674422239013,-0.7727644875559871,-0.7055403255703919,-0.6312666378723216,-0.5506855425976376,-0.46460217941375737,-0.373876664830236,-0.27941549819892586,-0.1821625042720959,-0.08308940281749641,0.016813900484349713,0.11654920485049364,0.21511998808781552,0.31154136351337786,0.40484992061659836,0.4941133511386082,0.5784397643882002,0.6569865987187891,0.7289690401258759,0.7936678638491531,0.8504366206285644,0.8987080958116269,0.9379999767747389,0.9679196720314863,0.9881682338770004,0.998543345374605,0.998941341839772,0.9893582466233818,0.9698898108450863,0.9407305566797731,0.9021718337562934,0.8545989080882805,0.7984871126234903,0.7343970978741134,0.6629692300821833,0.5849171928917617,0.5010208564578846,0.4121184852417566,0.3190983623493521,0.22288991410024764,0.12445442350706169,0.024775425453357765,-0.07515112046180931,-0.17432678122297965,-0.2717606264109424,-0.3664791292519284,-0.45753589377532133,-0.5440211108893699,-0.6250706488928821,-0.6998746875935424,-0.7676858097635825,-0.8278264690856536,-0.87969575997167,-0.9227754216128066,-0.9566350162701879,-0.9809362300664916,-0.9954362533063774,-0.9999902065507035,-0.9945525882039892,-0.9791777291513174,-0.954019249902089,-0.9193285256646757,-0.8754521746884285,-0.8228285949687089,-0.7619835839190333,-0.6935250847771224,-0.6181371122370333,-0.5365729180004349,-0.44964746453460147,-0.3582292822368287,-0.263231791365801,-0.1656041754483094,-0.06632189735120068,0.03362304722113669,0.13323204141994222,0.23150982510153895,0.32747443913769303,0.4201670368266409,0.5086614643723737,0.592073514707223,0.6695697621966024,0.7403758899524486,0.803784426551621,0.8591618148564959,0.9059547423084618,0.9436956694441048,0.9720075013949759,0.9906073556948704,0.9993093887479176,0.9980266527163617,0.9867719642746133,0.9656577765492775,0.934895055524683,0.8947911721405042,0.8457468311429343,0.7882520673753163,0.7228813495119761],\"line\":{\"shape\":\"spline\"},\"mode\":\"lines\"}],\n",
26
+ " {},\n",
27
+ " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
28
+ ")\n",
29
+ "\n",
30
+ "window.addEventListener('resize', function() {\n",
31
+ " Plotly.Plots.resize(document.getElementById('52d2f3bb-398d-4297-9a0e-482a9f2b5201'))\n",
32
+ "})\n",
33
+ " }) \n",
34
+ "</script>"
35
+ ],
36
+ "text/plain": [
37
+ "#<Plotly::Offline::HTML:0x007fa0ba9475c0 @id=\"52d2f3bb-398d-4297-9a0e-482a9f2b5201\", @data=[{:x=>[0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9], :y=>[0.09983341664682815, 0.19866933079506122, 0.29552020666133955, 0.3894183423086505, 0.479425538604203, 0.5646424733950354, 0.644217687237691, 0.7173560908995228, 0.7833269096274833, 0.8414709848078965, 0.8912073600614354, 0.9320390859672263, 0.963558185417193, 0.9854497299884601, 0.9974949866040544, 0.9995736030415051, 0.9916648104524686, 0.9738476308781951, 0.9463000876874145, 0.9092974268256817, 0.8632093666488738, 0.8084964038195901, 0.7457052121767203, 0.675463180551151, 0.5984721441039564, 0.5155013718214642, 0.4273798802338298, 0.33498815015590505, 0.2392493292139824, 0.1411200080598672, 0.04158066243329049, -0.058374143427580086, -0.1577456941432482, -0.2555411020268312, -0.35078322768961984, -0.44252044329485246, -0.5298361409084934, -0.6118578909427189, -0.6877661591839738, -0.7568024953079282, -0.8182771110644103, -0.8715757724135881, -0.9161659367494549, -0.9516020738895161, -0.977530117665097, -0.9936910036334644, -0.9999232575641008, -0.9961646088358407, -0.9824526126243325, -0.9589242746631385, -0.9258146823277325, -0.8834546557201531, -0.8322674422239013, -0.7727644875559871, -0.7055403255703919, -0.6312666378723216, -0.5506855425976376, -0.46460217941375737, -0.373876664830236, -0.27941549819892586, -0.1821625042720959, -0.08308940281749641, 0.016813900484349713, 0.11654920485049364, 0.21511998808781552, 0.31154136351337786, 0.40484992061659836, 0.4941133511386082, 0.5784397643882002, 0.6569865987187891, 0.7289690401258759, 0.7936678638491531, 0.8504366206285644, 0.8987080958116269, 0.9379999767747389, 0.9679196720314863, 0.9881682338770004, 0.998543345374605, 0.998941341839772, 0.9893582466233818, 0.9698898108450863, 0.9407305566797731, 0.9021718337562934, 0.8545989080882805, 0.7984871126234903, 0.7343970978741134, 0.6629692300821833, 0.5849171928917617, 0.5010208564578846, 0.4121184852417566, 0.3190983623493521, 0.22288991410024764, 0.12445442350706169, 0.024775425453357765, -0.07515112046180931, -0.17432678122297965, -0.2717606264109424, -0.3664791292519284, -0.45753589377532133], :line=>{:shape=>:spline}, :mode=>:lines}, {:x=>[0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9], :y=>[0.8912073600614354, 0.9320390859672263, 0.963558185417193, 0.9854497299884601, 0.9974949866040544, 0.9995736030415051, 0.9916648104524686, 0.9738476308781951, 0.9463000876874145, 0.9092974268256817, 0.8632093666488738, 0.8084964038195901, 0.7457052121767203, 0.675463180551151, 0.5984721441039564, 0.5155013718214642, 0.4273798802338298, 0.33498815015590505, 0.2392493292139824, 0.1411200080598672, 0.04158066243329049, -0.058374143427580086, -0.1577456941432482, -0.2555411020268312, -0.35078322768961984, -0.44252044329485246, -0.5298361409084934, -0.6118578909427189, -0.6877661591839738, -0.7568024953079282, -0.8182771110644103, -0.8715757724135881, -0.9161659367494549, -0.9516020738895161, -0.977530117665097, -0.9936910036334644, -0.9999232575641008, -0.9961646088358407, -0.9824526126243325, -0.9589242746631385, -0.9258146823277325, -0.8834546557201531, -0.8322674422239013, -0.7727644875559871, -0.7055403255703919, -0.6312666378723216, -0.5506855425976376, -0.46460217941375737, -0.373876664830236, -0.27941549819892586, -0.1821625042720959, -0.08308940281749641, 0.016813900484349713, 0.11654920485049364, 0.21511998808781552, 0.31154136351337786, 0.40484992061659836, 0.4941133511386082, 0.5784397643882002, 0.6569865987187891, 0.7289690401258759, 0.7936678638491531, 0.8504366206285644, 0.8987080958116269, 0.9379999767747389, 0.9679196720314863, 0.9881682338770004, 0.998543345374605, 0.998941341839772, 0.9893582466233818, 0.9698898108450863, 0.9407305566797731, 0.9021718337562934, 0.8545989080882805, 0.7984871126234903, 0.7343970978741134, 0.6629692300821833, 0.5849171928917617, 0.5010208564578846, 0.4121184852417566, 0.3190983623493521, 0.22288991410024764, 0.12445442350706169, 0.024775425453357765, -0.07515112046180931, -0.17432678122297965, -0.2717606264109424, -0.3664791292519284, -0.45753589377532133, -0.5440211108893699, -0.6250706488928821, -0.6998746875935424, -0.7676858097635825, -0.8278264690856536, -0.87969575997167, -0.9227754216128066, -0.9566350162701879, -0.9809362300664916, -0.9954362533063774], :line=>{:shape=>:spline}, :mode=>:lines}, {:x=>[0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9], :y=>[0.8632093666488738, 0.8084964038195901, 0.7457052121767203, 0.675463180551151, 0.5984721441039564, 0.5155013718214642, 0.4273798802338298, 0.33498815015590505, 0.2392493292139824, 0.1411200080598672, 0.04158066243329049, -0.058374143427580086, -0.1577456941432482, -0.2555411020268312, -0.35078322768961984, -0.44252044329485246, -0.5298361409084934, -0.6118578909427189, -0.6877661591839738, -0.7568024953079282, -0.8182771110644103, -0.8715757724135881, -0.9161659367494549, -0.9516020738895161, -0.977530117665097, -0.9936910036334644, -0.9999232575641008, -0.9961646088358407, -0.9824526126243325, -0.9589242746631385, -0.9258146823277325, -0.8834546557201531, -0.8322674422239013, -0.7727644875559871, -0.7055403255703919, -0.6312666378723216, -0.5506855425976376, -0.46460217941375737, -0.373876664830236, -0.27941549819892586, -0.1821625042720959, -0.08308940281749641, 0.016813900484349713, 0.11654920485049364, 0.21511998808781552, 0.31154136351337786, 0.40484992061659836, 0.4941133511386082, 0.5784397643882002, 0.6569865987187891, 0.7289690401258759, 0.7936678638491531, 0.8504366206285644, 0.8987080958116269, 0.9379999767747389, 0.9679196720314863, 0.9881682338770004, 0.998543345374605, 0.998941341839772, 0.9893582466233818, 0.9698898108450863, 0.9407305566797731, 0.9021718337562934, 0.8545989080882805, 0.7984871126234903, 0.7343970978741134, 0.6629692300821833, 0.5849171928917617, 0.5010208564578846, 0.4121184852417566, 0.3190983623493521, 0.22288991410024764, 0.12445442350706169, 0.024775425453357765, -0.07515112046180931, -0.17432678122297965, -0.2717606264109424, -0.3664791292519284, -0.45753589377532133, -0.5440211108893699, -0.6250706488928821, -0.6998746875935424, -0.7676858097635825, -0.8278264690856536, -0.87969575997167, -0.9227754216128066, -0.9566350162701879, -0.9809362300664916, -0.9954362533063774, -0.9999902065507035, -0.9945525882039892, -0.9791777291513174, -0.954019249902089, -0.9193285256646757, -0.8754521746884285, -0.8228285949687089, -0.7619835839190333, -0.6935250847771224, -0.6181371122370333], :line=>{:shape=>:spline}, :mode=>:lines}, {:x=>[0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9], :y=>[0.04158066243329049, -0.058374143427580086, -0.1577456941432482, -0.2555411020268312, -0.35078322768961984, -0.44252044329485246, -0.5298361409084934, -0.6118578909427189, -0.6877661591839738, -0.7568024953079282, -0.8182771110644103, -0.8715757724135881, -0.9161659367494549, -0.9516020738895161, -0.977530117665097, -0.9936910036334644, -0.9999232575641008, -0.9961646088358407, -0.9824526126243325, -0.9589242746631385, -0.9258146823277325, -0.8834546557201531, -0.8322674422239013, -0.7727644875559871, -0.7055403255703919, -0.6312666378723216, -0.5506855425976376, -0.46460217941375737, -0.373876664830236, -0.27941549819892586, -0.1821625042720959, -0.08308940281749641, 0.016813900484349713, 0.11654920485049364, 0.21511998808781552, 0.31154136351337786, 0.40484992061659836, 0.4941133511386082, 0.5784397643882002, 0.6569865987187891, 0.7289690401258759, 0.7936678638491531, 0.8504366206285644, 0.8987080958116269, 0.9379999767747389, 0.9679196720314863, 0.9881682338770004, 0.998543345374605, 0.998941341839772, 0.9893582466233818, 0.9698898108450863, 0.9407305566797731, 0.9021718337562934, 0.8545989080882805, 0.7984871126234903, 0.7343970978741134, 0.6629692300821833, 0.5849171928917617, 0.5010208564578846, 0.4121184852417566, 0.3190983623493521, 0.22288991410024764, 0.12445442350706169, 0.024775425453357765, -0.07515112046180931, -0.17432678122297965, -0.2717606264109424, -0.3664791292519284, -0.45753589377532133, -0.5440211108893699, -0.6250706488928821, -0.6998746875935424, -0.7676858097635825, -0.8278264690856536, -0.87969575997167, -0.9227754216128066, -0.9566350162701879, -0.9809362300664916, -0.9954362533063774, -0.9999902065507035, -0.9945525882039892, -0.9791777291513174, -0.954019249902089, -0.9193285256646757, -0.8754521746884285, -0.8228285949687089, -0.7619835839190333, -0.6935250847771224, -0.6181371122370333, -0.5365729180004349, -0.44964746453460147, -0.3582292822368287, -0.263231791365801, -0.1656041754483094, -0.06632189735120068, 0.03362304722113669, 0.13323204141994222, 0.23150982510153895, 0.32747443913769303], :line=>{:shape=>:spline}, :mode=>:lines}, {:x=>[0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9], :y=>[-0.8182771110644103, -0.8715757724135881, -0.9161659367494549, -0.9516020738895161, -0.977530117665097, -0.9936910036334644, -0.9999232575641008, -0.9961646088358407, -0.9824526126243325, -0.9589242746631385, -0.9258146823277325, -0.8834546557201531, -0.8322674422239013, -0.7727644875559871, -0.7055403255703919, -0.6312666378723216, -0.5506855425976376, -0.46460217941375737, -0.373876664830236, -0.27941549819892586, -0.1821625042720959, -0.08308940281749641, 0.016813900484349713, 0.11654920485049364, 0.21511998808781552, 0.31154136351337786, 0.40484992061659836, 0.4941133511386082, 0.5784397643882002, 0.6569865987187891, 0.7289690401258759, 0.7936678638491531, 0.8504366206285644, 0.8987080958116269, 0.9379999767747389, 0.9679196720314863, 0.9881682338770004, 0.998543345374605, 0.998941341839772, 0.9893582466233818, 0.9698898108450863, 0.9407305566797731, 0.9021718337562934, 0.8545989080882805, 0.7984871126234903, 0.7343970978741134, 0.6629692300821833, 0.5849171928917617, 0.5010208564578846, 0.4121184852417566, 0.3190983623493521, 0.22288991410024764, 0.12445442350706169, 0.024775425453357765, -0.07515112046180931, -0.17432678122297965, -0.2717606264109424, -0.3664791292519284, -0.45753589377532133, -0.5440211108893699, -0.6250706488928821, -0.6998746875935424, -0.7676858097635825, -0.8278264690856536, -0.87969575997167, -0.9227754216128066, -0.9566350162701879, -0.9809362300664916, -0.9954362533063774, -0.9999902065507035, -0.9945525882039892, -0.9791777291513174, -0.954019249902089, -0.9193285256646757, -0.8754521746884285, -0.8228285949687089, -0.7619835839190333, -0.6935250847771224, -0.6181371122370333, -0.5365729180004349, -0.44964746453460147, -0.3582292822368287, -0.263231791365801, -0.1656041754483094, -0.06632189735120068, 0.03362304722113669, 0.13323204141994222, 0.23150982510153895, 0.32747443913769303, 0.4201670368266409, 0.5086614643723737, 0.592073514707223, 0.6695697621966024, 0.7403758899524486, 0.803784426551621, 0.8591618148564959, 0.9059547423084618, 0.9436956694441048, 0.9720075013949759], :line=>{:shape=>:spline}, :mode=>:lines}, {:x=>[0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9], :y=>[-0.9258146823277325, -0.8834546557201531, -0.8322674422239013, -0.7727644875559871, -0.7055403255703919, -0.6312666378723216, -0.5506855425976376, -0.46460217941375737, -0.373876664830236, -0.27941549819892586, -0.1821625042720959, -0.08308940281749641, 0.016813900484349713, 0.11654920485049364, 0.21511998808781552, 0.31154136351337786, 0.40484992061659836, 0.4941133511386082, 0.5784397643882002, 0.6569865987187891, 0.7289690401258759, 0.7936678638491531, 0.8504366206285644, 0.8987080958116269, 0.9379999767747389, 0.9679196720314863, 0.9881682338770004, 0.998543345374605, 0.998941341839772, 0.9893582466233818, 0.9698898108450863, 0.9407305566797731, 0.9021718337562934, 0.8545989080882805, 0.7984871126234903, 0.7343970978741134, 0.6629692300821833, 0.5849171928917617, 0.5010208564578846, 0.4121184852417566, 0.3190983623493521, 0.22288991410024764, 0.12445442350706169, 0.024775425453357765, -0.07515112046180931, -0.17432678122297965, -0.2717606264109424, -0.3664791292519284, -0.45753589377532133, -0.5440211108893699, -0.6250706488928821, -0.6998746875935424, -0.7676858097635825, -0.8278264690856536, -0.87969575997167, -0.9227754216128066, -0.9566350162701879, -0.9809362300664916, -0.9954362533063774, -0.9999902065507035, -0.9945525882039892, -0.9791777291513174, -0.954019249902089, -0.9193285256646757, -0.8754521746884285, -0.8228285949687089, -0.7619835839190333, -0.6935250847771224, -0.6181371122370333, -0.5365729180004349, -0.44964746453460147, -0.3582292822368287, -0.263231791365801, -0.1656041754483094, -0.06632189735120068, 0.03362304722113669, 0.13323204141994222, 0.23150982510153895, 0.32747443913769303, 0.4201670368266409, 0.5086614643723737, 0.592073514707223, 0.6695697621966024, 0.7403758899524486, 0.803784426551621, 0.8591618148564959, 0.9059547423084618, 0.9436956694441048, 0.9720075013949759, 0.9906073556948704, 0.9993093887479176, 0.9980266527163617, 0.9867719642746133, 0.9656577765492775, 0.934895055524683, 0.8947911721405042, 0.8457468311429343, 0.7882520673753163, 0.7228813495119761], :line=>{:shape=>:spline}, :mode=>:lines}], @layout={}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
38
+ ]
39
+ },
40
+ "metadata": {},
41
+ "output_type": "display_data"
42
+ }
43
+ ],
44
+ "source": [
45
+ "require 'rbplotly'\n",
46
+ "\n",
47
+ "plot = Plotly::Plot.new\n",
48
+ "flip = -1\n",
49
+ "x = (0...100).map { |i| i.to_f / 10 }\n",
50
+ "(0..5).each do |i|\n",
51
+ " trace = {\n",
52
+ " x: x,\n",
53
+ " y: (1...100).map { |j| Math.sin(j.to_f / 10 + i) },\n",
54
+ " line: { shape: :spline },\n",
55
+ " mode: :lines\n",
56
+ " }\n",
57
+ " plot.data.push(trace)\n",
58
+ "end\n",
59
+ "\n",
60
+ "plot.show"
61
+ ]
62
+ },
63
+ {
64
+ "cell_type": "code",
65
+ "execution_count": null,
66
+ "metadata": {
67
+ "collapsed": true
68
+ },
69
+ "outputs": [],
70
+ "source": []
71
+ }
72
+ ],
73
+ "metadata": {
74
+ "kernelspec": {
75
+ "display_name": "Ruby 2.3.1",
76
+ "language": "ruby",
77
+ "name": "ruby"
78
+ },
79
+ "language_info": {
80
+ "file_extension": ".rb",
81
+ "mimetype": "application/x-ruby",
82
+ "name": "ruby",
83
+ "version": "2.3.1"
84
+ }
85
+ },
86
+ "nbformat": 4,
87
+ "nbformat_minor": 1
88
+ }
@@ -0,0 +1,151 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "metadata": {
7
+ "collapsed": false
8
+ },
9
+ "outputs": [
10
+ {
11
+ "data": {
12
+ "text/html": [
13
+ "\n",
14
+ " <script>\n",
15
+ " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
16
+ " </script>\n",
17
+ "\n",
18
+ "\n",
19
+ "<div id=\"de199c69-f935-4778-8724-3628dd873a18\" style=\"height: 100%; width: 100%;\"></div>\n",
20
+ "\n",
21
+ "<script>\n",
22
+ " require(['plotly'], function(Plotly) { \n",
23
+ "Plotly.newPlot(\n",
24
+ " 'de199c69-f935-4778-8724-3628dd873a18',\n",
25
+ " [{\"labels\":[\"Residential\",\"Non-Residential\",\"Utility\"],\"values\":[19,26,55],\"type\":\"pie\"}],\n",
26
+ " {\"title\":\"Forcasted 2014 U.S. PV Installations by Market Segment\"},\n",
27
+ " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
28
+ ")\n",
29
+ "\n",
30
+ "window.addEventListener('resize', function() {\n",
31
+ " Plotly.Plots.resize(document.getElementById('de199c69-f935-4778-8724-3628dd873a18'))\n",
32
+ "})\n",
33
+ " }) \n",
34
+ "</script>"
35
+ ],
36
+ "text/plain": [
37
+ "#<Plotly::Offline::HTML:0x007fb37a9e7660 @id=\"de199c69-f935-4778-8724-3628dd873a18\", @data=[{:labels=>[\"Residential\", \"Non-Residential\", \"Utility\"], :values=>[19, 26, 55], :type=>:pie}], @layout={:title=>\"Forcasted 2014 U.S. PV Installations by Market Segment\"}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
38
+ ]
39
+ },
40
+ "metadata": {},
41
+ "output_type": "display_data"
42
+ }
43
+ ],
44
+ "source": [
45
+ "# Basic Pie Chart\n",
46
+ "require 'rbplotly'\n",
47
+ "\n",
48
+ "data = [{\n",
49
+ " labels: %w(Residential Non-Residential Utility),\n",
50
+ " values: [19, 26, 55],\n",
51
+ " type: :pie\n",
52
+ "}]\n",
53
+ "\n",
54
+ "layout = { title: 'Forcasted 2014 U.S. PV Installations by Market Segment' }\n",
55
+ "\n",
56
+ "plot = Plotly::Plot.new(data: data, layout: layout )\n",
57
+ "plot.show"
58
+ ]
59
+ },
60
+ {
61
+ "cell_type": "code",
62
+ "execution_count": 2,
63
+ "metadata": {
64
+ "collapsed": false
65
+ },
66
+ "outputs": [
67
+ {
68
+ "data": {
69
+ "text/html": [
70
+ "\n",
71
+ " <script>\n",
72
+ " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
73
+ " </script>\n",
74
+ "\n",
75
+ "\n",
76
+ "<div id=\"f2ed54f8-f9fa-4386-b222-917ab5f9ef9e\" style=\"height: 100%; width: 100%;\"></div>\n",
77
+ "\n",
78
+ "<script>\n",
79
+ " require(['plotly'], function(Plotly) { \n",
80
+ "Plotly.newPlot(\n",
81
+ " 'f2ed54f8-f9fa-4386-b222-917ab5f9ef9e',\n",
82
+ " [{\"labels\":[\"US\",\"China\",\"European\",\"Union\",\"Russian\",\"Federation\",\"Brazil\",\"India\",\"Rest of World\"],\"values\":[16,15,12,6,5,4,42],\"type\":\"pie\",\"name\":\"GHG Emissions\",\"domain\":{\"x\":[0,0.5]},\"hoverinfo\":\"label+percent+name\",\"hole\":0.4},{\"labels\":[\"US\",\"China\",\"European\",\"Union\",\"Russian\",\"Federation\",\"Brazil\",\"India\",\"Rest of World\"],\"values\":[27,11,25,8,1,3,25],\"type\":\"pie\",\"name\":\"CO2 Emissions\",\"domain\":{\"x\":[0.5,1]},\"hoverinfo\":\"label+percent+name\",\"hole\":0.4}],\n",
83
+ " {},\n",
84
+ " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
85
+ ")\n",
86
+ "\n",
87
+ "window.addEventListener('resize', function() {\n",
88
+ " Plotly.Plots.resize(document.getElementById('f2ed54f8-f9fa-4386-b222-917ab5f9ef9e'))\n",
89
+ "})\n",
90
+ " }) \n",
91
+ "</script>"
92
+ ],
93
+ "text/plain": [
94
+ "#<Plotly::Offline::HTML:0x007fb37a94cde0 @id=\"f2ed54f8-f9fa-4386-b222-917ab5f9ef9e\", @data=[{:labels=>[\"US\", \"China\", \"European\", \"Union\", \"Russian\", \"Federation\", \"Brazil\", \"India\", \"Rest of World\"], :values=>[16, 15, 12, 6, 5, 4, 42], :type=>:pie, :name=>\"GHG Emissions\", :domain=>{:x=>[0, 0.5]}, :hoverinfo=>:\"label+percent+name\", :hole=>0.4}, {:labels=>[\"US\", \"China\", \"European\", \"Union\", \"Russian\", \"Federation\", \"Brazil\", \"India\", \"Rest of World\"], :values=>[27, 11, 25, 8, 1, 3, 25], :type=>:pie, :name=>\"CO2 Emissions\", :domain=>{:x=>[0.5, 1]}, :hoverinfo=>:\"label+percent+name\", :hole=>0.4}], @layout={}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
95
+ ]
96
+ },
97
+ "metadata": {},
98
+ "output_type": "display_data"
99
+ }
100
+ ],
101
+ "source": [
102
+ "# Donut Chart\n",
103
+ "require 'rbplotly'\n",
104
+ "\n",
105
+ "trace1 = {\n",
106
+ " name: 'GHG Emissions',\n",
107
+ " values: [16, 15, 12, 6, 5, 4, 42],\n",
108
+ " domain: { x: [0, 0.5] },\n",
109
+ " \n",
110
+ " labels: %w(US China European Union Russian Federation Brazil India Rest\\ of\\ World),\n",
111
+ " hoverinfo: :'label+percent+name',\n",
112
+ " hole: 0.4,\n",
113
+ " type: :pie,\n",
114
+ "}\n",
115
+ "\n",
116
+ "trace2 = trace1.merge({\n",
117
+ " name: 'CO2 Emissions',\n",
118
+ " values: [27, 11, 25, 8, 1, 3, 25],\n",
119
+ " domain: { x: [0.5, 1] }\n",
120
+ "})\n",
121
+ "\n",
122
+ "plot = Plotly::Plot.new(data: [trace1, trace2])\n",
123
+ "plot.show"
124
+ ]
125
+ },
126
+ {
127
+ "cell_type": "code",
128
+ "execution_count": null,
129
+ "metadata": {
130
+ "collapsed": true
131
+ },
132
+ "outputs": [],
133
+ "source": []
134
+ }
135
+ ],
136
+ "metadata": {
137
+ "kernelspec": {
138
+ "display_name": "Ruby 2.3.1",
139
+ "language": "ruby",
140
+ "name": "ruby"
141
+ },
142
+ "language_info": {
143
+ "file_extension": ".rb",
144
+ "mimetype": "application/x-ruby",
145
+ "name": "ruby",
146
+ "version": "2.3.1"
147
+ }
148
+ },
149
+ "nbformat": 4,
150
+ "nbformat_minor": 1
151
+ }
@@ -0,0 +1,224 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "metadata": {
7
+ "collapsed": false,
8
+ "scrolled": true
9
+ },
10
+ "outputs": [
11
+ {
12
+ "data": {
13
+ "text/html": [
14
+ "\n",
15
+ " <script>\n",
16
+ " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
17
+ " </script>\n",
18
+ "\n",
19
+ "\n",
20
+ "<div id=\"90f694b9-8a4a-4c67-b363-7f952ac495c4\" style=\"height: 100%; width: 100%;\"></div>\n",
21
+ "\n",
22
+ "<script>\n",
23
+ " require(['plotly'], function(Plotly) { \n",
24
+ "Plotly.newPlot(\n",
25
+ " '90f694b9-8a4a-4c67-b363-7f952ac495c4',\n",
26
+ " [{\"x\":[0.9830872428418371,-0.6225603167819811,-1.8927429261234985,0.3620417301915362,-0.8967459358524024,1.5693420544788879,-0.07209956504841974,0.13355848945233983,0.18059236921397037,-0.9929317709149887,0.6420493212346221,1.2666229469234862,0.2795420669676125,1.5733582432519486,1.008607379593721,-1.494596456886732,-0.7199443463025381,-1.2933920337711577,0.6182474107839244,-1.7934569650563699,-0.1517253205683584,-0.5368512662302765,-1.9344860908218133,-0.0478847044940931,-0.2677213348758505,0.09018520519235063,-0.7167723146640146,-0.7236792766516218,1.36905614305749,1.2918895211283181,1.4486912964720937,-1.5789298545505637,0.3731347053092362,1.19266386822612,-0.6699012127742399,0.47249573284765445,-0.9496941782848967,-0.13546443019163945,-1.1351345838320337,-0.7232932184696264,-0.6948411338760927,-1.525885404920444,0.5259016250315351,-0.6253247461324749,-0.05946292176105805,-0.06382740019979583,1.7278844016794217,0.13337981507349506,-1.209015254024421,-1.7734902232332188,0.4616553106917958,-0.739717530983631,-0.2957879066221283,-1.649982595578162,-1.2288183522659253,0.7506158917996504,1.676527254501626,-0.44970978611523327,-0.09440148916302382,0.6973834637913869,0.7213603427333002,0.4795520166151541,0.17444222360431771,0.46907480686981406,-0.8200283198901261,1.4486437667524865,0.5118384351441909,1.9705908811169155,-0.27857958507676095,-1.0500317981403309,-1.4089154299678368,0.02124590571956375,-0.548073563619607,0.7751855903961884,-1.600463831766561,0.4132203397200862,-0.20639510636106673,-0.06644707042592968,-1.476213226650383,0.15233939848949296,-0.5137663476822296,1.0149235388769742,1.9130911733481755,1.8508001493623563,-0.04132013555595515,-1.3424640697831824,-1.8040549987607384,0.8398217257160154,-0.13398376359694453,1.054566956239984,-1.192236640012144,-1.0018219627750864,1.0591464483713748,-1.0832181741273974,0.9280572333135351,0.009668021231714619,0.8673731196925516,0.9577732730386979,-0.6597110352767763,-0.9778170463783389],\"y\":[0.3235808471765018,0.2988918879324791,0.20862401922350426,0.371798692850025,0.18467527451358334,-0.11099213236821348,-0.2294685068760065,0.7633851388122197,0.4668827341799422,-0.701166222790357,-0.19955835447226078,-0.7929997738495342,-0.3674009612664828,-0.27983463429837596,0.6681020285301886,0.45231576101009074,0.7136146874523166,0.3971986812000863,-0.45162611173420997,0.9370488678419244,0.487683749146691,-0.4523058428184794,-0.6137442454568012,0.7234624498386468,-0.8580025742404265,-0.8952365278204981,-0.09713788849454041,0.46801522862498723,-0.3071396641323063,-0.4177566081548105,0.6877883694835158,0.41081999652773216,-0.3493185259795686,0.8366756946008098,0.2705686266505456,0.39547326250614634,0.8506909888327219,0.8271780546984624,-0.7165216665661047,0.7042164958468469,-0.36148601766412636,0.6629635790037178,0.1125482411682226,-0.47902240994993717,0.2542101298537811,-0.05799729578641544,-0.09279168806485605,-0.16328893677557965,0.2506203454024045,0.4655367021133021,0.5171815321531679,0.7497714725582865,0.15795731957241999,0.11689779887393414,-0.21276054236773323,-0.3251365074041408,0.17450014361807642,0.47764071968945787,0.38461096054872845,0.4434609251689494,0.915425972432268,0.8520887381958715,0.13354512278748776,0.4364230177690194,0.8721019754502335,0.5917902227140659,0.9792119165613946,0.6692188104007004,-0.5660322881343227,0.5862904575208066,0.2967423766103181,-0.3128825156321309,0.09736383435871132,0.5110664929240891,-0.8815665015513938,-0.079340193709444,-0.6192953726916963,-0.5749801634656355,0.4042520884820924,0.7169771749951117,0.38277248070074466,-0.6849891843473535,-0.7420083125086145,0.865723013818845,-0.6614814038930834,-0.400953840016808,0.4641653101078067,0.4922206811159511,0.45277683725445494,-0.6815557463706996,-0.12861311906255812,0.35132557397247055,0.36138319697419896,-0.8848025359543659,0.14725461748832336,-0.010147229192302376,-0.5470315230046927,-0.9376669396886039,-0.7662181340049801,-0.840462742778207],\"mode\":\"markers\"}],\n",
27
+ " {\"title\":\"Simple Scatter Plot\"},\n",
28
+ " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
29
+ ")\n",
30
+ "\n",
31
+ "window.addEventListener('resize', function() {\n",
32
+ " Plotly.Plots.resize(document.getElementById('90f694b9-8a4a-4c67-b363-7f952ac495c4'))\n",
33
+ "})\n",
34
+ " }) \n",
35
+ "</script>"
36
+ ],
37
+ "text/plain": [
38
+ "#<Plotly::Offline::HTML:0x007fe92241e5e8 @id=\"90f694b9-8a4a-4c67-b363-7f952ac495c4\", @data=[{:x=>[0.9830872428418371, -0.6225603167819811, -1.8927429261234985, 0.3620417301915362, -0.8967459358524024, 1.5693420544788879, -0.07209956504841974, 0.13355848945233983, 0.18059236921397037, -0.9929317709149887, 0.6420493212346221, 1.2666229469234862, 0.2795420669676125, 1.5733582432519486, 1.008607379593721, -1.494596456886732, -0.7199443463025381, -1.2933920337711577, 0.6182474107839244, -1.7934569650563699, -0.1517253205683584, -0.5368512662302765, -1.9344860908218133, -0.0478847044940931, -0.2677213348758505, 0.09018520519235063, -0.7167723146640146, -0.7236792766516218, 1.36905614305749, 1.2918895211283181, 1.4486912964720937, -1.5789298545505637, 0.3731347053092362, 1.19266386822612, -0.6699012127742399, 0.47249573284765445, -0.9496941782848967, -0.13546443019163945, -1.1351345838320337, -0.7232932184696264, -0.6948411338760927, -1.525885404920444, 0.5259016250315351, -0.6253247461324749, -0.05946292176105805, -0.06382740019979583, 1.7278844016794217, 0.13337981507349506, -1.209015254024421, -1.7734902232332188, 0.4616553106917958, -0.739717530983631, -0.2957879066221283, -1.649982595578162, -1.2288183522659253, 0.7506158917996504, 1.676527254501626, -0.44970978611523327, -0.09440148916302382, 0.6973834637913869, 0.7213603427333002, 0.4795520166151541, 0.17444222360431771, 0.46907480686981406, -0.8200283198901261, 1.4486437667524865, 0.5118384351441909, 1.9705908811169155, -0.27857958507676095, -1.0500317981403309, -1.4089154299678368, 0.02124590571956375, -0.548073563619607, 0.7751855903961884, -1.600463831766561, 0.4132203397200862, -0.20639510636106673, -0.06644707042592968, -1.476213226650383, 0.15233939848949296, -0.5137663476822296, 1.0149235388769742, 1.9130911733481755, 1.8508001493623563, -0.04132013555595515, -1.3424640697831824, -1.8040549987607384, 0.8398217257160154, -0.13398376359694453, 1.054566956239984, -1.192236640012144, -1.0018219627750864, 1.0591464483713748, -1.0832181741273974, 0.9280572333135351, 0.009668021231714619, 0.8673731196925516, 0.9577732730386979, -0.6597110352767763, -0.9778170463783389], :y=>[0.3235808471765018, 0.2988918879324791, 0.20862401922350426, 0.371798692850025, 0.18467527451358334, -0.11099213236821348, -0.2294685068760065, 0.7633851388122197, 0.4668827341799422, -0.701166222790357, -0.19955835447226078, -0.7929997738495342, -0.3674009612664828, -0.27983463429837596, 0.6681020285301886, 0.45231576101009074, 0.7136146874523166, 0.3971986812000863, -0.45162611173420997, 0.9370488678419244, 0.487683749146691, -0.4523058428184794, -0.6137442454568012, 0.7234624498386468, -0.8580025742404265, -0.8952365278204981, -0.09713788849454041, 0.46801522862498723, -0.3071396641323063, -0.4177566081548105, 0.6877883694835158, 0.41081999652773216, -0.3493185259795686, 0.8366756946008098, 0.2705686266505456, 0.39547326250614634, 0.8506909888327219, 0.8271780546984624, -0.7165216665661047, 0.7042164958468469, -0.36148601766412636, 0.6629635790037178, 0.1125482411682226, -0.47902240994993717, 0.2542101298537811, -0.05799729578641544, -0.09279168806485605, -0.16328893677557965, 0.2506203454024045, 0.4655367021133021, 0.5171815321531679, 0.7497714725582865, 0.15795731957241999, 0.11689779887393414, -0.21276054236773323, -0.3251365074041408, 0.17450014361807642, 0.47764071968945787, 0.38461096054872845, 0.4434609251689494, 0.915425972432268, 0.8520887381958715, 0.13354512278748776, 0.4364230177690194, 0.8721019754502335, 0.5917902227140659, 0.9792119165613946, 0.6692188104007004, -0.5660322881343227, 0.5862904575208066, 0.2967423766103181, -0.3128825156321309, 0.09736383435871132, 0.5110664929240891, -0.8815665015513938, -0.079340193709444, -0.6192953726916963, -0.5749801634656355, 0.4042520884820924, 0.7169771749951117, 0.38277248070074466, -0.6849891843473535, -0.7420083125086145, 0.865723013818845, -0.6614814038930834, -0.400953840016808, 0.4641653101078067, 0.4922206811159511, 0.45277683725445494, -0.6815557463706996, -0.12861311906255812, 0.35132557397247055, 0.36138319697419896, -0.8848025359543659, 0.14725461748832336, -0.010147229192302376, -0.5470315230046927, -0.9376669396886039, -0.7662181340049801, -0.840462742778207], :mode=>:markers}], @layout={:title=>\"Simple Scatter Plot\"}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
39
+ ]
40
+ },
41
+ "metadata": {},
42
+ "output_type": "display_data"
43
+ }
44
+ ],
45
+ "source": [
46
+ "# Simple Scatter Plot\n",
47
+ "require 'rbplotly'\n",
48
+ "\n",
49
+ "n = 100\n",
50
+ "x = n.times.map { rand(-2.0..2.0) }\n",
51
+ "y = n.times.map { rand(-1.0..1.0) }\n",
52
+ "trace = { x: x, y: y, mode: :markers }\n",
53
+ "\n",
54
+ "plot = Plotly::Plot.new(data: [trace])\n",
55
+ "plot.layout.title = 'Simple Scatter Plot'\n",
56
+ "plot.show"
57
+ ]
58
+ },
59
+ {
60
+ "cell_type": "code",
61
+ "execution_count": 2,
62
+ "metadata": {
63
+ "collapsed": false
64
+ },
65
+ "outputs": [
66
+ {
67
+ "data": {
68
+ "text/html": [
69
+ "\n",
70
+ " <script>\n",
71
+ " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
72
+ " </script>\n",
73
+ "\n",
74
+ "\n",
75
+ "<div id=\"09a6834a-4c97-427d-a69e-04c7f22415c9\" style=\"height: 100%; width: 100%;\"></div>\n",
76
+ "\n",
77
+ "<script>\n",
78
+ " require(['plotly'], function(Plotly) { \n",
79
+ "Plotly.newPlot(\n",
80
+ " '09a6834a-4c97-427d-a69e-04c7f22415c9',\n",
81
+ " [{\"x\":[0.0,0.010101010101010102,0.020202020202020204,0.030303030303030304,0.04040404040404041,0.050505050505050504,0.06060606060606061,0.0707070707070707,0.08080808080808081,0.09090909090909091,0.10101010101010101,0.1111111111111111,0.12121212121212122,0.13131313131313133,0.1414141414141414,0.15151515151515152,0.16161616161616163,0.1717171717171717,0.18181818181818182,0.1919191919191919,0.20202020202020202,0.21212121212121213,0.2222222222222222,0.23232323232323232,0.24242424242424243,0.25252525252525254,0.26262626262626265,0.2727272727272727,0.2828282828282828,0.29292929292929293,0.30303030303030304,0.31313131313131315,0.32323232323232326,0.3333333333333333,0.3434343434343434,0.35353535353535354,0.36363636363636365,0.37373737373737376,0.3838383838383838,0.3939393939393939,0.40404040404040403,0.41414141414141414,0.42424242424242425,0.43434343434343436,0.4444444444444444,0.45454545454545453,0.46464646464646464,0.47474747474747475,0.48484848484848486,0.494949494949495,0.5050505050505051,0.5151515151515151,0.5252525252525253,0.5353535353535354,0.5454545454545454,0.5555555555555556,0.5656565656565656,0.5757575757575758,0.5858585858585859,0.5959595959595959,0.6060606060606061,0.6161616161616161,0.6262626262626263,0.6363636363636364,0.6464646464646465,0.6565656565656566,0.6666666666666666,0.6767676767676768,0.6868686868686869,0.696969696969697,0.7070707070707071,0.7171717171717171,0.7272727272727273,0.7373737373737373,0.7474747474747475,0.7575757575757576,0.7676767676767676,0.7777777777777778,0.7878787878787878,0.797979797979798,0.8080808080808081,0.8181818181818182,0.8282828282828283,0.8383838383838383,0.8484848484848485,0.8585858585858586,0.8686868686868687,0.8787878787878788,0.8888888888888888,0.898989898989899,0.9090909090909091,0.9191919191919192,0.9292929292929293,0.9393939393939394,0.9494949494949495,0.9595959595959596,0.9696969696969697,0.9797979797979798,0.98989898989899,1.0],\"y\":[4.247470548881884,5.169428895083312,4.842244427723106,6.823886837720078,5.207335303369803,3.2052687058727836,6.836003685217147,4.381255791307273,6.49859753847609,6.702391373171487,5.470611394732682,6.226536593155121,5.740304440043028,4.848230032947744,5.058965858773757,5.648584442330111,4.111585103396571,6.283024895137276,5.340688938937516,4.867547315990633,5.165986609385863,6.448152610429574,4.6979409566741985,3.6185006814237313,5.366109009561779,4.727838178227663,4.623447644095657,4.471351794853983,6.281562638627852,5.642252893227801,3.8127461282674613,5.088140041839074,5.209501443555029,3.208503653368289,6.609156467748448,4.237767847411515,5.962925389183473,5.12534908840254,5.543164750755135,5.022679413996901,5.318711374291473,5.5551187084058,3.94587129534561,6.436854924023905,3.3774746370481123,3.9679046475717814,5.602877601235169,4.353954737406442,3.0870108206255633,5.910873280604742,3.5157246579910457,4.774725459542218,3.4323169902860333,6.512701475356604,6.835729279683669,3.884742157386016,6.505590495455239,5.609943078052654,5.042011972590753,6.41924854114353,3.0499973881819353,3.039461163568763,5.068708112159804,6.991222081429316,3.9993963513464585,3.9353750740898827,4.127861657102761,6.681925156204539,5.0071592708003045,3.104939653632926,4.620763583357126,5.257296519522721,6.151094311529544,6.837031087255758,3.471316325132468,4.322848217411935,6.616942324668534,4.06859056833647,5.582380648833455,6.596840640058366,5.040259276092109,4.378199829794868,5.831216755655913,4.925677186120785,4.502431125692542,3.4760232283277337,3.208553356299087,4.428432183356875,5.132268100535056,6.482729663991031,5.777880817747489,5.520099822974071,5.382124176710549,4.862542219028493,4.291177522197528,6.437846935089938,5.506734388772037,3.412993940377485,6.200609119700282,4.986666392131754],\"mode\":\"markers\",\"type\":\"scatter\"},{\"x\":[0.0,0.010101010101010102,0.020202020202020204,0.030303030303030304,0.04040404040404041,0.050505050505050504,0.06060606060606061,0.0707070707070707,0.08080808080808081,0.09090909090909091,0.10101010101010101,0.1111111111111111,0.12121212121212122,0.13131313131313133,0.1414141414141414,0.15151515151515152,0.16161616161616163,0.1717171717171717,0.18181818181818182,0.1919191919191919,0.20202020202020202,0.21212121212121213,0.2222222222222222,0.23232323232323232,0.24242424242424243,0.25252525252525254,0.26262626262626265,0.2727272727272727,0.2828282828282828,0.29292929292929293,0.30303030303030304,0.31313131313131315,0.32323232323232326,0.3333333333333333,0.3434343434343434,0.35353535353535354,0.36363636363636365,0.37373737373737376,0.3838383838383838,0.3939393939393939,0.40404040404040403,0.41414141414141414,0.42424242424242425,0.43434343434343436,0.4444444444444444,0.45454545454545453,0.46464646464646464,0.47474747474747475,0.48484848484848486,0.494949494949495,0.5050505050505051,0.5151515151515151,0.5252525252525253,0.5353535353535354,0.5454545454545454,0.5555555555555556,0.5656565656565656,0.5757575757575758,0.5858585858585859,0.5959595959595959,0.6060606060606061,0.6161616161616161,0.6262626262626263,0.6363636363636364,0.6464646464646465,0.6565656565656566,0.6666666666666666,0.6767676767676768,0.6868686868686869,0.696969696969697,0.7070707070707071,0.7171717171717171,0.7272727272727273,0.7373737373737373,0.7474747474747475,0.7575757575757576,0.7676767676767676,0.7777777777777778,0.7878787878787878,0.797979797979798,0.8080808080808081,0.8181818181818182,0.8282828282828283,0.8383838383838383,0.8484848484848485,0.8585858585858586,0.8686868686868687,0.8787878787878788,0.8888888888888888,0.898989898989899,0.9090909090909091,0.9191919191919192,0.9292929292929293,0.9393939393939394,0.9494949494949495,0.9595959595959596,0.9696969696969697,0.9797979797979798,0.98989898989899,1.0],\"y\":[-0.5180349952193395,-1.2466174037595437,1.4538888066913511,0.4347398094477337,0.6341491553925813,-0.7657891381872628,-1.3928855521686416,-0.835663726499376,-0.4503788505282649,-1.407571101604188,-1.4108237930894059,-0.10934345626844166,-1.0670663593557026,0.8147165361885089,-0.31298794936893115,0.956494105090389,-1.0209467082359027,0.7812707360399389,1.6791217454396161,-0.15704535865981617,0.1905243318157983,1.4549506536220407,-1.4137584544957433,-1.073488024478361,0.026390654670235936,1.7165151806785448,1.913480006216047,-0.9091510507303293,-1.5147183539806899,1.9735194007179264,0.0586441152738435,0.6150766236302334,1.4833116371543063,-1.4805287985596172,-0.051929430510845975,-1.5004084355786054,-1.586872129065926,0.9369181581461996,-1.8805481916276139,1.1361495003214213,-0.05236417188351172,-0.3757381912157354,1.8528999981487417,-1.8259885984439412,1.8552645968630346,0.7295035827329457,0.7261487934676008,-0.12850085420664836,0.2224197063856419,-0.5181508633672931,-0.7268181146375157,-1.1897294086208543,-0.212645693097556,-0.42239358324636767,-1.8989767801692006,-0.990635074909,-1.2264446031432827,0.05437570569077366,-0.34809093406520075,0.6407588948636782,-1.7634089827541737,-1.6978797354395136,-0.19092047452274263,-1.5885913741273576,-1.0673668209950424,1.723843911036321,0.1482953498435471,1.2958831333690255,0.9822353376094282,-1.48091394032513,0.5361183046421987,-1.469466707816471,-1.0803545132014882,-1.700982853405757,1.1561616928409162,0.753100934635035,-1.7709130828223754,0.31397691640908043,0.6282367475212403,-0.6427315131864102,-1.837743421796096,-0.8905293612767782,1.2803365890010268,-0.39253863696012825,1.5651156496980465,1.5321140697111928,1.239172355068853,-0.5373103488494424,-0.7657637211696771,0.6168303243474016,0.32705333773711676,1.7610578268634693,-1.2669824732907715,-1.4261060331948814,-0.845817806461111,-0.4313244011001487,0.9750419961661314,-1.2079509771964685,0.6141435216204458,-1.875417497563154],\"mode\":\"markers+lines\",\"type\":\"scatter\"},{\"x\":[0.0,0.010101010101010102,0.020202020202020204,0.030303030303030304,0.04040404040404041,0.050505050505050504,0.06060606060606061,0.0707070707070707,0.08080808080808081,0.09090909090909091,0.10101010101010101,0.1111111111111111,0.12121212121212122,0.13131313131313133,0.1414141414141414,0.15151515151515152,0.16161616161616163,0.1717171717171717,0.18181818181818182,0.1919191919191919,0.20202020202020202,0.21212121212121213,0.2222222222222222,0.23232323232323232,0.24242424242424243,0.25252525252525254,0.26262626262626265,0.2727272727272727,0.2828282828282828,0.29292929292929293,0.30303030303030304,0.31313131313131315,0.32323232323232326,0.3333333333333333,0.3434343434343434,0.35353535353535354,0.36363636363636365,0.37373737373737376,0.3838383838383838,0.3939393939393939,0.40404040404040403,0.41414141414141414,0.42424242424242425,0.43434343434343436,0.4444444444444444,0.45454545454545453,0.46464646464646464,0.47474747474747475,0.48484848484848486,0.494949494949495,0.5050505050505051,0.5151515151515151,0.5252525252525253,0.5353535353535354,0.5454545454545454,0.5555555555555556,0.5656565656565656,0.5757575757575758,0.5858585858585859,0.5959595959595959,0.6060606060606061,0.6161616161616161,0.6262626262626263,0.6363636363636364,0.6464646464646465,0.6565656565656566,0.6666666666666666,0.6767676767676768,0.6868686868686869,0.696969696969697,0.7070707070707071,0.7171717171717171,0.7272727272727273,0.7373737373737373,0.7474747474747475,0.7575757575757576,0.7676767676767676,0.7777777777777778,0.7878787878787878,0.797979797979798,0.8080808080808081,0.8181818181818182,0.8282828282828283,0.8383838383838383,0.8484848484848485,0.8585858585858586,0.8686868686868687,0.8787878787878788,0.8888888888888888,0.898989898989899,0.9090909090909091,0.9191919191919192,0.9292929292929293,0.9393939393939394,0.9494949494949495,0.9595959595959596,0.9696969696969697,0.9797979797979798,0.98989898989899,1.0],\"y\":[-5.911562730593112,-4.7710669766536355,-4.65304148909687,-3.3043448744936725,-4.302016405739801,-4.74780881296411,-6.844880296667599,-5.407105266989042,-5.389455001533959,-5.093228405999657,-5.048176671850813,-4.324296929808622,-6.1643330032054955,-5.854584346648479,-5.754651057760054,-4.318160545732443,-5.401858942277179,-3.418475467420896,-6.6872010941882785,-4.597030172889722,-5.743369871427371,-3.308161973747469,-4.92773397736281,-4.620440425148205,-5.857311699118613,-3.8637004174743828,-3.215574832475108,-3.1155978017178074,-3.922273096575759,-6.879017168985545,-4.594617837641749,-5.893983494966882,-3.481054177965182,-6.270274731695452,-4.3768001220933765,-4.855396825767537,-4.286056827206488,-4.968593318193882,-5.615063329811569,-5.170771661351324,-5.343037984226849,-5.31911317233853,-3.879560181427026,-5.691647922277806,-4.781032278876815,-6.027027307745252,-5.828551344163651,-4.155881097484674,-5.3234644163569715,-3.906657906794074,-3.8232152502770367,-5.733463554438815,-4.7429348067706565,-3.0299545232310234,-3.101283769981061,-5.455566678109969,-4.199248188036956,-4.95797082650061,-4.535637646169345,-5.205730460721194,-5.987688381390624,-4.290308680302518,-6.502782831152736,-5.719608486548758,-5.735934709548534,-6.600278572889426,-6.448593832188314,-4.569348195620822,-5.257607105834079,-3.6198998912212885,-6.8237152179513,-3.309529967325279,-3.7448639732054247,-6.538190412369541,-6.931756919085865,-6.625812926806752,-6.997963791456476,-4.868413938235729,-6.122765905740515,-5.515869685563766,-6.428440486329031,-5.779286993197192,-3.7996303791845807,-5.008868848817141,-3.2040322319036414,-3.2969727012674173,-5.576545092183218,-3.517210833777502,-5.764760522484327,-4.352069990519425,-4.867620053856879,-6.070185005516046,-3.5345644569219763,-5.617451538939019,-4.435910573023019,-3.1464065020501666,-4.60367399076932,-4.039697657072183,-4.82523045085523,-4.7354618140367775],\"mode\":\"lines\",\"type\":\"scatter\"}],\n",
82
+ " {\"title\":\"Line and Scatter Plots\"},\n",
83
+ " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
84
+ ")\n",
85
+ "\n",
86
+ "window.addEventListener('resize', function() {\n",
87
+ " Plotly.Plots.resize(document.getElementById('09a6834a-4c97-427d-a69e-04c7f22415c9'))\n",
88
+ "})\n",
89
+ " }) \n",
90
+ "</script>"
91
+ ],
92
+ "text/plain": [
93
+ "#<Plotly::Offline::HTML:0x007fe921d48818 @id=\"09a6834a-4c97-427d-a69e-04c7f22415c9\", @data=[{:x=>[0.0, 0.010101010101010102, 0.020202020202020204, 0.030303030303030304, 0.04040404040404041, 0.050505050505050504, 0.06060606060606061, 0.0707070707070707, 0.08080808080808081, 0.09090909090909091, 0.10101010101010101, 0.1111111111111111, 0.12121212121212122, 0.13131313131313133, 0.1414141414141414, 0.15151515151515152, 0.16161616161616163, 0.1717171717171717, 0.18181818181818182, 0.1919191919191919, 0.20202020202020202, 0.21212121212121213, 0.2222222222222222, 0.23232323232323232, 0.24242424242424243, 0.25252525252525254, 0.26262626262626265, 0.2727272727272727, 0.2828282828282828, 0.29292929292929293, 0.30303030303030304, 0.31313131313131315, 0.32323232323232326, 0.3333333333333333, 0.3434343434343434, 0.35353535353535354, 0.36363636363636365, 0.37373737373737376, 0.3838383838383838, 0.3939393939393939, 0.40404040404040403, 0.41414141414141414, 0.42424242424242425, 0.43434343434343436, 0.4444444444444444, 0.45454545454545453, 0.46464646464646464, 0.47474747474747475, 0.48484848484848486, 0.494949494949495, 0.5050505050505051, 0.5151515151515151, 0.5252525252525253, 0.5353535353535354, 0.5454545454545454, 0.5555555555555556, 0.5656565656565656, 0.5757575757575758, 0.5858585858585859, 0.5959595959595959, 0.6060606060606061, 0.6161616161616161, 0.6262626262626263, 0.6363636363636364, 0.6464646464646465, 0.6565656565656566, 0.6666666666666666, 0.6767676767676768, 0.6868686868686869, 0.696969696969697, 0.7070707070707071, 0.7171717171717171, 0.7272727272727273, 0.7373737373737373, 0.7474747474747475, 0.7575757575757576, 0.7676767676767676, 0.7777777777777778, 0.7878787878787878, 0.797979797979798, 0.8080808080808081, 0.8181818181818182, 0.8282828282828283, 0.8383838383838383, 0.8484848484848485, 0.8585858585858586, 0.8686868686868687, 0.8787878787878788, 0.8888888888888888, 0.898989898989899, 0.9090909090909091, 0.9191919191919192, 0.9292929292929293, 0.9393939393939394, 0.9494949494949495, 0.9595959595959596, 0.9696969696969697, 0.9797979797979798, 0.98989898989899, 1.0], :y=>[4.247470548881884, 5.169428895083312, 4.842244427723106, 6.823886837720078, 5.207335303369803, 3.2052687058727836, 6.836003685217147, 4.381255791307273, 6.49859753847609, 6.702391373171487, 5.470611394732682, 6.226536593155121, 5.740304440043028, 4.848230032947744, 5.058965858773757, 5.648584442330111, 4.111585103396571, 6.283024895137276, 5.340688938937516, 4.867547315990633, 5.165986609385863, 6.448152610429574, 4.6979409566741985, 3.6185006814237313, 5.366109009561779, 4.727838178227663, 4.623447644095657, 4.471351794853983, 6.281562638627852, 5.642252893227801, 3.8127461282674613, 5.088140041839074, 5.209501443555029, 3.208503653368289, 6.609156467748448, 4.237767847411515, 5.962925389183473, 5.12534908840254, 5.543164750755135, 5.022679413996901, 5.318711374291473, 5.5551187084058, 3.94587129534561, 6.436854924023905, 3.3774746370481123, 3.9679046475717814, 5.602877601235169, 4.353954737406442, 3.0870108206255633, 5.910873280604742, 3.5157246579910457, 4.774725459542218, 3.4323169902860333, 6.512701475356604, 6.835729279683669, 3.884742157386016, 6.505590495455239, 5.609943078052654, 5.042011972590753, 6.41924854114353, 3.0499973881819353, 3.039461163568763, 5.068708112159804, 6.991222081429316, 3.9993963513464585, 3.9353750740898827, 4.127861657102761, 6.681925156204539, 5.0071592708003045, 3.104939653632926, 4.620763583357126, 5.257296519522721, 6.151094311529544, 6.837031087255758, 3.471316325132468, 4.322848217411935, 6.616942324668534, 4.06859056833647, 5.582380648833455, 6.596840640058366, 5.040259276092109, 4.378199829794868, 5.831216755655913, 4.925677186120785, 4.502431125692542, 3.4760232283277337, 3.208553356299087, 4.428432183356875, 5.132268100535056, 6.482729663991031, 5.777880817747489, 5.520099822974071, 5.382124176710549, 4.862542219028493, 4.291177522197528, 6.437846935089938, 5.506734388772037, 3.412993940377485, 6.200609119700282, 4.986666392131754], :mode=>:markers, :type=>:scatter}, {:x=>[0.0, 0.010101010101010102, 0.020202020202020204, 0.030303030303030304, 0.04040404040404041, 0.050505050505050504, 0.06060606060606061, 0.0707070707070707, 0.08080808080808081, 0.09090909090909091, 0.10101010101010101, 0.1111111111111111, 0.12121212121212122, 0.13131313131313133, 0.1414141414141414, 0.15151515151515152, 0.16161616161616163, 0.1717171717171717, 0.18181818181818182, 0.1919191919191919, 0.20202020202020202, 0.21212121212121213, 0.2222222222222222, 0.23232323232323232, 0.24242424242424243, 0.25252525252525254, 0.26262626262626265, 0.2727272727272727, 0.2828282828282828, 0.29292929292929293, 0.30303030303030304, 0.31313131313131315, 0.32323232323232326, 0.3333333333333333, 0.3434343434343434, 0.35353535353535354, 0.36363636363636365, 0.37373737373737376, 0.3838383838383838, 0.3939393939393939, 0.40404040404040403, 0.41414141414141414, 0.42424242424242425, 0.43434343434343436, 0.4444444444444444, 0.45454545454545453, 0.46464646464646464, 0.47474747474747475, 0.48484848484848486, 0.494949494949495, 0.5050505050505051, 0.5151515151515151, 0.5252525252525253, 0.5353535353535354, 0.5454545454545454, 0.5555555555555556, 0.5656565656565656, 0.5757575757575758, 0.5858585858585859, 0.5959595959595959, 0.6060606060606061, 0.6161616161616161, 0.6262626262626263, 0.6363636363636364, 0.6464646464646465, 0.6565656565656566, 0.6666666666666666, 0.6767676767676768, 0.6868686868686869, 0.696969696969697, 0.7070707070707071, 0.7171717171717171, 0.7272727272727273, 0.7373737373737373, 0.7474747474747475, 0.7575757575757576, 0.7676767676767676, 0.7777777777777778, 0.7878787878787878, 0.797979797979798, 0.8080808080808081, 0.8181818181818182, 0.8282828282828283, 0.8383838383838383, 0.8484848484848485, 0.8585858585858586, 0.8686868686868687, 0.8787878787878788, 0.8888888888888888, 0.898989898989899, 0.9090909090909091, 0.9191919191919192, 0.9292929292929293, 0.9393939393939394, 0.9494949494949495, 0.9595959595959596, 0.9696969696969697, 0.9797979797979798, 0.98989898989899, 1.0], :y=>[-0.5180349952193395, -1.2466174037595437, 1.4538888066913511, 0.4347398094477337, 0.6341491553925813, -0.7657891381872628, -1.3928855521686416, -0.835663726499376, -0.4503788505282649, -1.407571101604188, -1.4108237930894059, -0.10934345626844166, -1.0670663593557026, 0.8147165361885089, -0.31298794936893115, 0.956494105090389, -1.0209467082359027, 0.7812707360399389, 1.6791217454396161, -0.15704535865981617, 0.1905243318157983, 1.4549506536220407, -1.4137584544957433, -1.073488024478361, 0.026390654670235936, 1.7165151806785448, 1.913480006216047, -0.9091510507303293, -1.5147183539806899, 1.9735194007179264, 0.0586441152738435, 0.6150766236302334, 1.4833116371543063, -1.4805287985596172, -0.051929430510845975, -1.5004084355786054, -1.586872129065926, 0.9369181581461996, -1.8805481916276139, 1.1361495003214213, -0.05236417188351172, -0.3757381912157354, 1.8528999981487417, -1.8259885984439412, 1.8552645968630346, 0.7295035827329457, 0.7261487934676008, -0.12850085420664836, 0.2224197063856419, -0.5181508633672931, -0.7268181146375157, -1.1897294086208543, -0.212645693097556, -0.42239358324636767, -1.8989767801692006, -0.990635074909, -1.2264446031432827, 0.05437570569077366, -0.34809093406520075, 0.6407588948636782, -1.7634089827541737, -1.6978797354395136, -0.19092047452274263, -1.5885913741273576, -1.0673668209950424, 1.723843911036321, 0.1482953498435471, 1.2958831333690255, 0.9822353376094282, -1.48091394032513, 0.5361183046421987, -1.469466707816471, -1.0803545132014882, -1.700982853405757, 1.1561616928409162, 0.753100934635035, -1.7709130828223754, 0.31397691640908043, 0.6282367475212403, -0.6427315131864102, -1.837743421796096, -0.8905293612767782, 1.2803365890010268, -0.39253863696012825, 1.5651156496980465, 1.5321140697111928, 1.239172355068853, -0.5373103488494424, -0.7657637211696771, 0.6168303243474016, 0.32705333773711676, 1.7610578268634693, -1.2669824732907715, -1.4261060331948814, -0.845817806461111, -0.4313244011001487, 0.9750419961661314, -1.2079509771964685, 0.6141435216204458, -1.875417497563154], :mode=>:\"markers+lines\", :type=>:scatter}, {:x=>[0.0, 0.010101010101010102, 0.020202020202020204, 0.030303030303030304, 0.04040404040404041, 0.050505050505050504, 0.06060606060606061, 0.0707070707070707, 0.08080808080808081, 0.09090909090909091, 0.10101010101010101, 0.1111111111111111, 0.12121212121212122, 0.13131313131313133, 0.1414141414141414, 0.15151515151515152, 0.16161616161616163, 0.1717171717171717, 0.18181818181818182, 0.1919191919191919, 0.20202020202020202, 0.21212121212121213, 0.2222222222222222, 0.23232323232323232, 0.24242424242424243, 0.25252525252525254, 0.26262626262626265, 0.2727272727272727, 0.2828282828282828, 0.29292929292929293, 0.30303030303030304, 0.31313131313131315, 0.32323232323232326, 0.3333333333333333, 0.3434343434343434, 0.35353535353535354, 0.36363636363636365, 0.37373737373737376, 0.3838383838383838, 0.3939393939393939, 0.40404040404040403, 0.41414141414141414, 0.42424242424242425, 0.43434343434343436, 0.4444444444444444, 0.45454545454545453, 0.46464646464646464, 0.47474747474747475, 0.48484848484848486, 0.494949494949495, 0.5050505050505051, 0.5151515151515151, 0.5252525252525253, 0.5353535353535354, 0.5454545454545454, 0.5555555555555556, 0.5656565656565656, 0.5757575757575758, 0.5858585858585859, 0.5959595959595959, 0.6060606060606061, 0.6161616161616161, 0.6262626262626263, 0.6363636363636364, 0.6464646464646465, 0.6565656565656566, 0.6666666666666666, 0.6767676767676768, 0.6868686868686869, 0.696969696969697, 0.7070707070707071, 0.7171717171717171, 0.7272727272727273, 0.7373737373737373, 0.7474747474747475, 0.7575757575757576, 0.7676767676767676, 0.7777777777777778, 0.7878787878787878, 0.797979797979798, 0.8080808080808081, 0.8181818181818182, 0.8282828282828283, 0.8383838383838383, 0.8484848484848485, 0.8585858585858586, 0.8686868686868687, 0.8787878787878788, 0.8888888888888888, 0.898989898989899, 0.9090909090909091, 0.9191919191919192, 0.9292929292929293, 0.9393939393939394, 0.9494949494949495, 0.9595959595959596, 0.9696969696969697, 0.9797979797979798, 0.98989898989899, 1.0], :y=>[-5.911562730593112, -4.7710669766536355, -4.65304148909687, -3.3043448744936725, -4.302016405739801, -4.74780881296411, -6.844880296667599, -5.407105266989042, -5.389455001533959, -5.093228405999657, -5.048176671850813, -4.324296929808622, -6.1643330032054955, -5.854584346648479, -5.754651057760054, -4.318160545732443, -5.401858942277179, -3.418475467420896, -6.6872010941882785, -4.597030172889722, -5.743369871427371, -3.308161973747469, -4.92773397736281, -4.620440425148205, -5.857311699118613, -3.8637004174743828, -3.215574832475108, -3.1155978017178074, -3.922273096575759, -6.879017168985545, -4.594617837641749, -5.893983494966882, -3.481054177965182, -6.270274731695452, -4.3768001220933765, -4.855396825767537, -4.286056827206488, -4.968593318193882, -5.615063329811569, -5.170771661351324, -5.343037984226849, -5.31911317233853, -3.879560181427026, -5.691647922277806, -4.781032278876815, -6.027027307745252, -5.828551344163651, -4.155881097484674, -5.3234644163569715, -3.906657906794074, -3.8232152502770367, -5.733463554438815, -4.7429348067706565, -3.0299545232310234, -3.101283769981061, -5.455566678109969, -4.199248188036956, -4.95797082650061, -4.535637646169345, -5.205730460721194, -5.987688381390624, -4.290308680302518, -6.502782831152736, -5.719608486548758, -5.735934709548534, -6.600278572889426, -6.448593832188314, -4.569348195620822, -5.257607105834079, -3.6198998912212885, -6.8237152179513, -3.309529967325279, -3.7448639732054247, -6.538190412369541, -6.931756919085865, -6.625812926806752, -6.997963791456476, -4.868413938235729, -6.122765905740515, -5.515869685563766, -6.428440486329031, -5.779286993197192, -3.7996303791845807, -5.008868848817141, -3.2040322319036414, -3.2969727012674173, -5.576545092183218, -3.517210833777502, -5.764760522484327, -4.352069990519425, -4.867620053856879, -6.070185005516046, -3.5345644569219763, -5.617451538939019, -4.435910573023019, -3.1464065020501666, -4.60367399076932, -4.039697657072183, -4.82523045085523, -4.7354618140367775], :mode=>:lines, :type=>:scatter}], @layout={:title=>\"Line and Scatter Plots\"}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
94
+ ]
95
+ },
96
+ "metadata": {},
97
+ "output_type": "display_data"
98
+ }
99
+ ],
100
+ "source": [
101
+ "# Line and Scatter Plots\n",
102
+ "require 'rbplotly'\n",
103
+ "\n",
104
+ "n = 100\n",
105
+ "\n",
106
+ "x = n.times.map { |i| i.to_f / (n - 1) }\n",
107
+ "y0 = n.times.map { rand(-2.0..2.0) + 5 }\n",
108
+ "y1 = n.times.map { rand(-2.0..2.0) }\n",
109
+ "y2 = n.times.map { rand(-2.0..2.0) - 5 }\n",
110
+ "\n",
111
+ "trace0 = { x: x, y: y0, type: :scatter, mode: :markers }\n",
112
+ "trace1 = { x: x, y: y1, type: :scatter, mode: :'markers+lines' }\n",
113
+ "trace2 = { x: x, y: y2, type: :scatter, mode: :lines }\n",
114
+ "\n",
115
+ "plot = Plotly::Plot.new(data: [trace0, trace1, trace2])\n",
116
+ "plot.layout.title = 'Line and Scatter Plots'\n",
117
+ "plot.show"
118
+ ]
119
+ },
120
+ {
121
+ "cell_type": "code",
122
+ "execution_count": 3,
123
+ "metadata": {
124
+ "collapsed": false
125
+ },
126
+ "outputs": [
127
+ {
128
+ "data": {
129
+ "text/html": [
130
+ "\n",
131
+ " <script>\n",
132
+ " requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min'] }})\n",
133
+ " </script>\n",
134
+ "\n",
135
+ "\n",
136
+ "<div id=\"95c4ac07-0937-41f6-bda1-d859af96c5e6\" style=\"height: 100%; width: 100%;\"></div>\n",
137
+ "\n",
138
+ "<script>\n",
139
+ " require(['plotly'], function(Plotly) { \n",
140
+ "Plotly.newPlot(\n",
141
+ " '95c4ac07-0937-41f6-bda1-d859af96c5e6',\n",
142
+ " [{\"x\":[0.408447943195168,-1.6799942842778268,1.5885080384868746,-0.366687262204644,-0.37234049836155325,0.8905521938964132,-1.989481179444843,-1.6130796556994262,-1.2882658154879705,0.8988328171241764,1.536496061182774,-0.3926413722629034,-0.1433584798531089,-0.408129083184412,-0.2640099777909408,0.9584283429846772,-0.33517150830701414,-1.9167234781313787,-1.2199272854353054,1.3850602838776216,1.2193949310394805,-1.9910544260457206,0.2324309243164273,0.6782618696038121,0.12614063799266617,-0.4361569945554553,1.619704264017336,0.8406289255714521,0.4423830708657168,-0.1142976194907499,-0.7438705576570559,-1.7665558154494216,0.01939164886392586,0.12295292054859397,1.2114188103194183,0.11940661998504698,1.0484627610409438,-0.19193819077282992,1.875715964897707,-1.283398727951779,-1.0796208504149543,1.7890582832450548,1.802021826280627,1.071328909947416,-1.1892367091093266,1.656996941629283,-1.331337285354401,1.176819417025147,-0.7497391160132891,1.5247526981682493,0.5970963184672984,-0.6691748360508796,1.560239271155504,-0.9600390627758371,0.35894388364275276,-1.9394802335597867,-0.5234996368625291,0.3274374661164283,-1.1226113081517082,0.9308146683988223,0.5860382209047605,-0.9914030630331498,0.2976772732206583,1.0221650137019962,-0.9566972456057035,0.35831386103400886,1.4044337928393196,-1.1334740131466314,0.9260178142923334,0.5456614414231868,1.5665616362766386,0.6632900748439798,-0.6775173892891493,1.4827553621977652,-0.2178207308215323,1.1803860619313742,-1.9786467311253406,0.9785981932623309,0.44104940735907405,0.4421545952423056,-1.3332034618322828,0.3369751747368923,1.5431362552977128,1.05908337421713,1.3185528186518796,-1.1716201520200555,-1.980526135910576,-1.7806676288472385,1.5671694258974393,0.4471592367726007,-1.8123072606343373,1.8772407049994082,1.923953141050056,0.0957092212786641,-0.13205635155587858,-1.7563104539176053,-0.23058059261726216,-1.8897725179950666,0.26421127706217007,1.4950661550422293],\"y\":[-0.1712722502368258,0.9277347195960495,0.7139326369436669,0.9746097549959858,0.5843030081893967,-0.17346109843429702,0.7940281916926499,-0.3623788282217155,-0.071218073888073,0.9229302190223962,-0.3661350296433239,-0.4358242848220819,-0.19289629726606572,0.21638849883525535,-0.9259759346778751,0.241060284049176,0.055040329257568965,-0.1500773380613465,0.21978343016298396,-0.15105385005400662,-0.3033829677018165,-0.45110640316938944,0.46914174967103306,0.1505702808511209,-0.28108030715223364,-0.6867741423852287,0.04166353845249149,0.232395835554301,-0.4182747741245354,-0.6159875344298218,-0.09486678852995123,-0.9237946289483296,0.4589161233184671,-0.7429822067511569,0.669686095052531,-0.9923117444255933,-0.19711423035948372,-0.715250035858408,0.2700525309863653,-0.3412144509220034,0.2274566387505268,0.886283472217591,0.4971809338751543,0.9331592300052736,0.5377880512632771,-0.8133091514074504,-0.1959184492825765,0.42647480082472944,0.8731137784366965,-0.3589863131579609,-0.82565876463856,-0.04484057819695275,-0.618056339016982,-0.5105230075426337,-0.9831899512780315,-0.2509682854607349,0.43327932229122945,0.4106315976797137,-0.9310488921033964,-0.5232768628901803,0.05235498946850248,-0.680416440341703,0.7924835836962842,0.9634347250878459,-0.8299607670849249,0.13185533243132874,0.3428125408604812,-0.39364603298363066,-0.26348267489785004,0.7728267246264373,0.5844536089439596,0.5502189628331731,0.7781620352296954,-0.3708117000724165,0.6121384520404245,-0.8641922239208224,0.9214006069505383,0.8980455989329967,-0.3135169488355265,0.2667098861524515,0.7808784845815313,0.6409156584722056,-0.21950203040591054,0.6932673778176266,0.06578739446913384,-0.38383862093429433,-0.8546412102123011,0.30417569113382736,0.0666861856755212,-0.7789117335883231,0.45569966338938395,-0.634635721183354,-0.9107403125862796,-0.9942175873057089,-0.32255119562428747,-0.025152748313265638,0.6550356699643258,-0.5361039130372542,-0.17129223787990755,-0.7695528995454786],\"mode\":\"markers\",\"name\":\"Red\",\"marker\":{\"size\":15,\"color\":\"rgba(200, 0, 0, .5)\",\"line\":{\"width\":2,\"color\":\"rgb(0, 0, 0, .5)\"}}},{\"x\":[-1.1771517021481164,-0.5273477632172576,-1.331661001662237,-1.6869137982407318,1.8240818872782119,-1.884120467676882,-0.9904138569172023,-0.20054996099324818,-1.29928716488544,0.5957213818196494,-0.5393008266019894,0.4917328440521236,-0.5003346560022255,-0.945483573064668,-1.2339370427292966,0.6570349243550853,-0.7946844220086602,0.45129207886723455,-0.4931138284510781,-1.8184659684046536,0.26918475582889334,0.8020354768011324,1.769945288323329,0.29644263128645987,1.694203536472819,-0.03440251209717937,0.49236732973323116,-1.6999709422833953,-1.115666120384656,1.403115306510958,0.979854398771776,-0.4642527612867662,-0.7351231311968118,0.15657803856307417,0.813690226435392,1.3117502771609235,-0.3456254946478361,1.792295357726314,0.3676185851716496,-1.7424924085364473,0.02522711507205111,0.45041369346647553,-1.0832763968307826,-0.2068756493299797,-0.8815602728147809,-1.5444110748270465,-1.4068918750021178,-1.591200850420997,1.854983807047502,-0.3996328506038931,-1.421711076741111,1.1098377606989072,-1.9399635144689298,-1.4697502229785453,0.8451061611490251,-0.03004260724751484,1.6405789174001386,-0.6843506915922712,0.7826976949291744,1.4486786898296589,-0.27566870715187664,-0.7452831393706685,-1.3465695989279736,-0.707803561012275,-1.5248134524770744,1.2517109989716841,-1.698422101510277,-0.8936716088555143,1.0259116847234502,0.6658360001378432,-1.4351753901057887,-1.4243272402121026,-1.4488862001040896,1.0133308151484153,-0.39417924744365296,0.6947792568490043,0.633052447908101,0.6039960641851199,-1.766046491505115,-0.5798265595182932,-0.7348799916687265,-0.9290347002737667,1.2104272219106424,-0.5683061955980797,-0.5572915347592247,0.04431247725985532,-1.6084664253895955,-0.7465910830667903,-0.45850357894209326,-0.6640641981784685,0.07657012980491862,0.7906525140253677,-1.667597014153933,0.02740580105241941,-1.729316095460533,-1.1451393324118837,0.1729224663790534,-1.8403456217635528,0.5583963360622866,1.4476928727282532],\"y\":[-0.37836333200601313,-0.8332190838275382,-0.8055982119502088,0.6950183099093798,0.289535669944494,-0.9137124034600153,-0.1082084719079528,0.34270649860618874,-0.7811716424440589,-0.3663345422632984,-0.3691950004155711,-0.2906977843353773,-0.9305719786393851,0.612793458702743,-0.973164815870524,-0.40576578920398365,-0.9559539326860726,0.8428523303095659,0.4979307678389926,-0.6023844707729291,-0.4233384335912833,0.6798163700032793,0.9579034047204946,0.061431825196619716,-0.3076394034784524,-0.3334524831458163,-0.8515356724532552,-0.12735797799876813,0.3406256563806309,-0.21270604558958683,0.8797700875045693,0.24725025990617855,0.4917859000915086,0.5640538227559415,-0.12856350332069977,-0.08813349276050775,0.4332995748250468,0.4232565906605916,-0.3943502588290233,-0.6797947928758181,0.7943898534262839,-0.4526627008802828,0.6233133436446385,-0.11131103429623623,-0.3874748213676378,0.8337355272040547,0.2715167444572639,-0.8584321918627249,-0.6115634255070941,0.22616285321084106,0.7543730629979384,0.8340983948005263,0.3982042465559783,0.7989100265645284,-0.9772153058979922,0.6931705832906583,0.6169356923497451,0.6940690279752664,0.9486272672811129,-0.9768050594045368,0.0982642749541982,0.8928613488640995,0.957336246397755,-0.889760410323813,-0.27167549790352385,0.8780461041075536,0.9128317324935324,0.25923784598940025,0.4142070057305327,-0.3385147276101719,0.39428277369592646,0.37571934760751313,0.018431039024757734,0.9837491560526106,-0.20013418668112726,0.21985465542350768,0.6029292332755896,0.824763969231465,0.5827781893359794,0.1047990785136299,-0.6909587610986805,0.16829485818391965,0.3950448701549232,-0.775258934556303,-0.5176142591218722,-0.34764806601780696,-0.9813655105280907,0.8378389927949574,0.20852533363106174,-0.8618070705150545,-0.02828836901444931,0.7446566918137085,-0.17521321809111723,-0.22835389258552463,-0.3821892978900021,-0.23386800452723078,0.04291637077951238,-0.676444748659714,-0.987982521135234,-0.2651135827346984],\"mode\":\"markers\",\"name\":\"Blue\",\"marker\":{\"size\":10,\"color\":\"rgba(0, 0, 200, .5)\",\"line\":{\"width\":1,\"color\":\"rgb(0, 0, 0, .5)\"}}}],\n",
143
+ " {\"title\":\"Styled Scatter\",\"xaxis\":{\"zeroline\":false},\"yaxis\":{\"zeroline\":false}},\n",
144
+ " {\"linkText\":\"Export to plot.ly\",\"showLink\":true}\n",
145
+ ")\n",
146
+ "\n",
147
+ "window.addEventListener('resize', function() {\n",
148
+ " Plotly.Plots.resize(document.getElementById('95c4ac07-0937-41f6-bda1-d859af96c5e6'))\n",
149
+ "})\n",
150
+ " }) \n",
151
+ "</script>"
152
+ ],
153
+ "text/plain": [
154
+ "#<Plotly::Offline::HTML:0x007fe922687708 @id=\"95c4ac07-0937-41f6-bda1-d859af96c5e6\", @data=[{:x=>[0.408447943195168, -1.6799942842778268, 1.5885080384868746, -0.366687262204644, -0.37234049836155325, 0.8905521938964132, -1.989481179444843, -1.6130796556994262, -1.2882658154879705, 0.8988328171241764, 1.536496061182774, -0.3926413722629034, -0.1433584798531089, -0.408129083184412, -0.2640099777909408, 0.9584283429846772, -0.33517150830701414, -1.9167234781313787, -1.2199272854353054, 1.3850602838776216, 1.2193949310394805, -1.9910544260457206, 0.2324309243164273, 0.6782618696038121, 0.12614063799266617, -0.4361569945554553, 1.619704264017336, 0.8406289255714521, 0.4423830708657168, -0.1142976194907499, -0.7438705576570559, -1.7665558154494216, 0.01939164886392586, 0.12295292054859397, 1.2114188103194183, 0.11940661998504698, 1.0484627610409438, -0.19193819077282992, 1.875715964897707, -1.283398727951779, -1.0796208504149543, 1.7890582832450548, 1.802021826280627, 1.071328909947416, -1.1892367091093266, 1.656996941629283, -1.331337285354401, 1.176819417025147, -0.7497391160132891, 1.5247526981682493, 0.5970963184672984, -0.6691748360508796, 1.560239271155504, -0.9600390627758371, 0.35894388364275276, -1.9394802335597867, -0.5234996368625291, 0.3274374661164283, -1.1226113081517082, 0.9308146683988223, 0.5860382209047605, -0.9914030630331498, 0.2976772732206583, 1.0221650137019962, -0.9566972456057035, 0.35831386103400886, 1.4044337928393196, -1.1334740131466314, 0.9260178142923334, 0.5456614414231868, 1.5665616362766386, 0.6632900748439798, -0.6775173892891493, 1.4827553621977652, -0.2178207308215323, 1.1803860619313742, -1.9786467311253406, 0.9785981932623309, 0.44104940735907405, 0.4421545952423056, -1.3332034618322828, 0.3369751747368923, 1.5431362552977128, 1.05908337421713, 1.3185528186518796, -1.1716201520200555, -1.980526135910576, -1.7806676288472385, 1.5671694258974393, 0.4471592367726007, -1.8123072606343373, 1.8772407049994082, 1.923953141050056, 0.0957092212786641, -0.13205635155587858, -1.7563104539176053, -0.23058059261726216, -1.8897725179950666, 0.26421127706217007, 1.4950661550422293], :y=>[-0.1712722502368258, 0.9277347195960495, 0.7139326369436669, 0.9746097549959858, 0.5843030081893967, -0.17346109843429702, 0.7940281916926499, -0.3623788282217155, -0.071218073888073, 0.9229302190223962, -0.3661350296433239, -0.4358242848220819, -0.19289629726606572, 0.21638849883525535, -0.9259759346778751, 0.241060284049176, 0.055040329257568965, -0.1500773380613465, 0.21978343016298396, -0.15105385005400662, -0.3033829677018165, -0.45110640316938944, 0.46914174967103306, 0.1505702808511209, -0.28108030715223364, -0.6867741423852287, 0.04166353845249149, 0.232395835554301, -0.4182747741245354, -0.6159875344298218, -0.09486678852995123, -0.9237946289483296, 0.4589161233184671, -0.7429822067511569, 0.669686095052531, -0.9923117444255933, -0.19711423035948372, -0.715250035858408, 0.2700525309863653, -0.3412144509220034, 0.2274566387505268, 0.886283472217591, 0.4971809338751543, 0.9331592300052736, 0.5377880512632771, -0.8133091514074504, -0.1959184492825765, 0.42647480082472944, 0.8731137784366965, -0.3589863131579609, -0.82565876463856, -0.04484057819695275, -0.618056339016982, -0.5105230075426337, -0.9831899512780315, -0.2509682854607349, 0.43327932229122945, 0.4106315976797137, -0.9310488921033964, -0.5232768628901803, 0.05235498946850248, -0.680416440341703, 0.7924835836962842, 0.9634347250878459, -0.8299607670849249, 0.13185533243132874, 0.3428125408604812, -0.39364603298363066, -0.26348267489785004, 0.7728267246264373, 0.5844536089439596, 0.5502189628331731, 0.7781620352296954, -0.3708117000724165, 0.6121384520404245, -0.8641922239208224, 0.9214006069505383, 0.8980455989329967, -0.3135169488355265, 0.2667098861524515, 0.7808784845815313, 0.6409156584722056, -0.21950203040591054, 0.6932673778176266, 0.06578739446913384, -0.38383862093429433, -0.8546412102123011, 0.30417569113382736, 0.0666861856755212, -0.7789117335883231, 0.45569966338938395, -0.634635721183354, -0.9107403125862796, -0.9942175873057089, -0.32255119562428747, -0.025152748313265638, 0.6550356699643258, -0.5361039130372542, -0.17129223787990755, -0.7695528995454786], :mode=>:markers, :name=>\"Red\", :marker=>{:size=>15, :color=>\"rgba(200, 0, 0, .5)\", :line=>{:width=>2, :color=>\"rgb(0, 0, 0, .5)\"}}}, {:x=>[-1.1771517021481164, -0.5273477632172576, -1.331661001662237, -1.6869137982407318, 1.8240818872782119, -1.884120467676882, -0.9904138569172023, -0.20054996099324818, -1.29928716488544, 0.5957213818196494, -0.5393008266019894, 0.4917328440521236, -0.5003346560022255, -0.945483573064668, -1.2339370427292966, 0.6570349243550853, -0.7946844220086602, 0.45129207886723455, -0.4931138284510781, -1.8184659684046536, 0.26918475582889334, 0.8020354768011324, 1.769945288323329, 0.29644263128645987, 1.694203536472819, -0.03440251209717937, 0.49236732973323116, -1.6999709422833953, -1.115666120384656, 1.403115306510958, 0.979854398771776, -0.4642527612867662, -0.7351231311968118, 0.15657803856307417, 0.813690226435392, 1.3117502771609235, -0.3456254946478361, 1.792295357726314, 0.3676185851716496, -1.7424924085364473, 0.02522711507205111, 0.45041369346647553, -1.0832763968307826, -0.2068756493299797, -0.8815602728147809, -1.5444110748270465, -1.4068918750021178, -1.591200850420997, 1.854983807047502, -0.3996328506038931, -1.421711076741111, 1.1098377606989072, -1.9399635144689298, -1.4697502229785453, 0.8451061611490251, -0.03004260724751484, 1.6405789174001386, -0.6843506915922712, 0.7826976949291744, 1.4486786898296589, -0.27566870715187664, -0.7452831393706685, -1.3465695989279736, -0.707803561012275, -1.5248134524770744, 1.2517109989716841, -1.698422101510277, -0.8936716088555143, 1.0259116847234502, 0.6658360001378432, -1.4351753901057887, -1.4243272402121026, -1.4488862001040896, 1.0133308151484153, -0.39417924744365296, 0.6947792568490043, 0.633052447908101, 0.6039960641851199, -1.766046491505115, -0.5798265595182932, -0.7348799916687265, -0.9290347002737667, 1.2104272219106424, -0.5683061955980797, -0.5572915347592247, 0.04431247725985532, -1.6084664253895955, -0.7465910830667903, -0.45850357894209326, -0.6640641981784685, 0.07657012980491862, 0.7906525140253677, -1.667597014153933, 0.02740580105241941, -1.729316095460533, -1.1451393324118837, 0.1729224663790534, -1.8403456217635528, 0.5583963360622866, 1.4476928727282532], :y=>[-0.37836333200601313, -0.8332190838275382, -0.8055982119502088, 0.6950183099093798, 0.289535669944494, -0.9137124034600153, -0.1082084719079528, 0.34270649860618874, -0.7811716424440589, -0.3663345422632984, -0.3691950004155711, -0.2906977843353773, -0.9305719786393851, 0.612793458702743, -0.973164815870524, -0.40576578920398365, -0.9559539326860726, 0.8428523303095659, 0.4979307678389926, -0.6023844707729291, -0.4233384335912833, 0.6798163700032793, 0.9579034047204946, 0.061431825196619716, -0.3076394034784524, -0.3334524831458163, -0.8515356724532552, -0.12735797799876813, 0.3406256563806309, -0.21270604558958683, 0.8797700875045693, 0.24725025990617855, 0.4917859000915086, 0.5640538227559415, -0.12856350332069977, -0.08813349276050775, 0.4332995748250468, 0.4232565906605916, -0.3943502588290233, -0.6797947928758181, 0.7943898534262839, -0.4526627008802828, 0.6233133436446385, -0.11131103429623623, -0.3874748213676378, 0.8337355272040547, 0.2715167444572639, -0.8584321918627249, -0.6115634255070941, 0.22616285321084106, 0.7543730629979384, 0.8340983948005263, 0.3982042465559783, 0.7989100265645284, -0.9772153058979922, 0.6931705832906583, 0.6169356923497451, 0.6940690279752664, 0.9486272672811129, -0.9768050594045368, 0.0982642749541982, 0.8928613488640995, 0.957336246397755, -0.889760410323813, -0.27167549790352385, 0.8780461041075536, 0.9128317324935324, 0.25923784598940025, 0.4142070057305327, -0.3385147276101719, 0.39428277369592646, 0.37571934760751313, 0.018431039024757734, 0.9837491560526106, -0.20013418668112726, 0.21985465542350768, 0.6029292332755896, 0.824763969231465, 0.5827781893359794, 0.1047990785136299, -0.6909587610986805, 0.16829485818391965, 0.3950448701549232, -0.775258934556303, -0.5176142591218722, -0.34764806601780696, -0.9813655105280907, 0.8378389927949574, 0.20852533363106174, -0.8618070705150545, -0.02828836901444931, 0.7446566918137085, -0.17521321809111723, -0.22835389258552463, -0.3821892978900021, -0.23386800452723078, 0.04291637077951238, -0.676444748659714, -0.987982521135234, -0.2651135827346984], :mode=>:markers, :name=>\"Blue\", :marker=>{:size=>10, :color=>\"rgba(0, 0, 200, .5)\", :line=>{:width=>1, :color=>\"rgb(0, 0, 0, .5)\"}}}], @layout={:title=>\"Styled Scatter\", :xaxis=>{:zeroline=>false}, :yaxis=>{:zeroline=>false}}, @config={:linkText=>\"Export to plot.ly\", :showLink=>true}, @embedded=true>"
155
+ ]
156
+ },
157
+ "metadata": {},
158
+ "output_type": "display_data"
159
+ }
160
+ ],
161
+ "source": [
162
+ "# Style Scatter Plots\n",
163
+ "require 'rbplotly'\n",
164
+ "\n",
165
+ "n = 100\n",
166
+ "trace0 = {\n",
167
+ " x: n.times.map { rand(-2.0..2.0) },\n",
168
+ " y: n.times.map { rand(-1.0..1.0) },\n",
169
+ " name: 'Red',\n",
170
+ " mode: :markers,\n",
171
+ " marker: {\n",
172
+ " size: 15,\n",
173
+ " color: 'rgba(200, 0, 0, .5)',\n",
174
+ " line: { width: 2, color: 'rgb(0, 0, 0, .5)' }\n",
175
+ " }\n",
176
+ "}\n",
177
+ "trace1 = {\n",
178
+ " x: n.times.map { rand(-2.0..2.0) },\n",
179
+ " y: n.times.map { rand(-1.0..1.0) },\n",
180
+ " name: 'Blue',\n",
181
+ " mode: :markers,\n",
182
+ " marker: {\n",
183
+ " size: 10,\n",
184
+ " color: 'rgba(0, 0, 200, .5)',\n",
185
+ " line: { width: 1, color: 'rgb(0, 0, 0, .5)' }\n",
186
+ " }\n",
187
+ "}\n",
188
+ "\n",
189
+ "layout = {\n",
190
+ " title: 'Styled Scatter',\n",
191
+ " xaxis: { zeroline: false },\n",
192
+ " yaxis: { zeroline: false }\n",
193
+ "}\n",
194
+ "\n",
195
+ "plot = Plotly::Plot.new(data: [trace0, trace1], layout: layout)\n",
196
+ "plot.show"
197
+ ]
198
+ },
199
+ {
200
+ "cell_type": "code",
201
+ "execution_count": null,
202
+ "metadata": {
203
+ "collapsed": true
204
+ },
205
+ "outputs": [],
206
+ "source": []
207
+ }
208
+ ],
209
+ "metadata": {
210
+ "kernelspec": {
211
+ "display_name": "Ruby 2.3.1",
212
+ "language": "ruby",
213
+ "name": "ruby"
214
+ },
215
+ "language_info": {
216
+ "file_extension": ".rb",
217
+ "mimetype": "application/x-ruby",
218
+ "name": "ruby",
219
+ "version": "2.3.1"
220
+ }
221
+ },
222
+ "nbformat": 4,
223
+ "nbformat_minor": 1
224
+ }