{ "metadata": { "language": "ruby", "name": "", "signature": "sha256:05fa7f66a567f399d1f232267463646f23f39ea17b8603e0abcd54fa42da871e" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "require 'nyaplot'" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "" ], "metadata": {}, "output_type": "pyout", "prompt_number": 1, "text": [ "\"if(window['d3'] === undefined ||\\n window['Nyaplot'] === undefined){\\n var path = {\\\"d3\\\":\\\"http://d3js.org/d3.v3.min\\\"};\\n\\n\\n\\n var shim = {\\\"d3\\\":{\\\"exports\\\":\\\"d3\\\"}};\\n\\n require.config({paths: path, shim:shim});\\n\\n\\nrequire(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');\\n\\n\\tvar script = d3.select(\\\"head\\\")\\n\\t .append(\\\"script\\\")\\n\\t .attr(\\\"src\\\", \\\"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\\\")\\n\\t .attr(\\\"async\\\", true);\\n\\n\\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\\n\\n\\n\\t var event = document.createEvent(\\\"HTMLEvents\\\");\\n\\t event.initEvent(\\\"load_nyaplot\\\",false,false);\\n\\t window.dispatchEvent(event);\\n\\t console.log('Finished loading Nyaplotjs');\\n\\n\\t};\\n\\n\\n});\\n}\\n\"" ] }, { "metadata": {}, "output_type": "pyout", "prompt_number": 1, "text": [ "true" ] } ], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [ "path = File.expand_path(\"../data/11-2-result0.01.csv\", __FILE__)\n", "df = Nyaplot::DataFrame.from_csv(path)" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
t | v | w |
---|---|---|
0.0 | -0.756836 | 3.812226 |
0.1 | -0.04511 | 3.40354 |
0.2 | -2.017709 | 3.075507 |
0.3 | 1.709506 | 2.679731 |
0.4 | 0.570858 | 2.645426 |
0.5 | -1.100874 | 2.490375 |
0.6 | -1.278126 | 2.191405 |
0.7 | -1.328045 | 1.913642 |
0.8 | -1.514909 | 1.661195 |
0.9 | -1.572689 | 1.425256 |
1.0 | -1.658116 | 1.211392 |
1.1 | -1.690351 | 1.016707 |
1.2 | -1.664759 | 0.841834 |
1.3 | -1.597433 | 0.686942 |
1.4 | -1.511524 | 0.551852 |
1.5 | -1.416929 | 0.435926 |
... | ... | ... |
100.0 | 1.432378 | 1.528758 |