Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Nyaplotの紹介@U-22プロコン
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
domitry
October 06, 2014
Technology
210
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Nyaplotの紹介@U-22プロコン
domitry
October 06, 2014
Transcript
24 slides
Nyaplot v0.1.1 ⼤阪⼤学 基礎⼯学部 2年 ⻄⽥ 直樹 (※このページの画像は以下の通りライセンスされています)
Nyaplot Ruby向けのインタラクティブなプロット⽤ライブラリ データの解析・加⼯と可視化、プロットのWebへの出⼒を Rubyで⼀貫して⾏う プログラミング初⼼者の学⽣・研究者でも数⾏でプロット
インタラクティブ性 (1/2) Prototyping (試⾏錯誤しながらプロットを作る) 対話的に⾊決め、データ解析
インタラクティブ性 (2/2) Viewing (閲覧者がデータに触れることができる) PC・タブレット・スマホのブラウザで表⽰
Case 1: 物理系の研究室 教授「Strange Attractorの初期値鋭敏性を体感してもらう Webサイトを作りたい!」 Excelで試してから同じものをJavaScriptで実装する…?
None
None
Erbテンプレートへ notebookで書いたコードに数⾏の追加で実現 <title>Nyaplot</title> <script src="http://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.14/require.min.js"></script> <script> </script> <form method="post" action="/">
<input type="submit" value="submit"> </form> <%= Nyaplot.generate_init_code %> <%= @frame.generate_body %> <%= str=""; @p.each{|k, v| str += "#{k}: <input type="\"text\"" name="\"#{k}\"" value="\"#{v}\""><br>"
Case2: 統計学のレポート 「⾵速・海⽔温・地震のデータをそれぞれ可視化し、考察 を含めてレポートにせよ」 matplotlibのプロットをpngで出⼒しepsに変換、TeXに張 り付け…?
None
レポート提出 ⾃動⽣成されたNotebookをDropboxへアップロード
Nyaplotの夢 「科学分野でRubyを使ってもらいたい!」 現在使われている⾔語はバラバラ (例えば解析:R, 可視化:matplotlib, 出⼒: Rails) 利⽤者(学⽣・研究者)にはフラストレーションの溜まる状 況
Nyaplotは最先端 JavaScriptの台頭で情勢が変わりつつある 各⾔語のライブラリがこぞってJavaScriptと連携 PythonのBokeh, matplotlib, Plotlyなど Nyaplotはその中でも最先端 WebGLでの3Dプロットのサポート IRuby notebookとの密な連携
まとめ Ruby向けプロットライブラリNyaplot ⾼い⽣産性(数⾏で複雑なプロットができる) インタラクティブ性 Prototyping (対話的なプロットの作成) Viewing (ブラウザでプロットに触る) Nyaplotの未来 Rubyの科学分野での普及
Nyaplotは最先端(JavaScript, WebGL)
補⾜
拡張機能 RubyとJavaScriptで⾮常に短く実装 地図を実装するのにRuby約100⾏+JavaScript約200⾏ これだけで国別に塗り分けしたり気候情報を地図上にプロ ットできる
拡張機能 Plot, Diagram, Scale等にモジュール分け 両者は同じDiagram(Nyaplot::Diagrams::Scatter) 座標系のみを新しく定義し同じDiagramを⼆度実装しない
⼆種類のAPI 簡単なプロットと複雑なプロットの両⽅を簡潔に作りたい 統⼀された2つのAPI 簡単なプロット: Arrayベース 複雑なプロット: DataFrameベース
DataFrameベース R⾵, データを解析・加⼯する際に向いている DataFrameを作った後、⾏(column)の名前を指定 df = DataFrame.from_csv("path_to_csv_file") sc = plot.add_with_df(df,
:scatter, :x, :y) sc.fill_by(:home) sc.shape_by(:home) sc.tooltip_contents([:name, :home])
Arrayベース matplotlib⾵, データがRubyのオブジェクトとしてすでにあ る場合に有⽤(Strange Attractorの例など) 配列(Array)をそのまま代⼊してプロット plot.add(:bar, [:hoge, :hunya, :nyaa],
[0.3, 1.0, 2.0])
その他のプロット :2D View notebook
その他のプロット :3D View notebook
その他のプロット :Mapnya View notebook
その他のプロット :Bionya View notebook
More Decks by domitry
See All by domitry
Topics about SciRuby @dcmodel/davis tutorial, Kobe
domitry
0
260
The Elements of Statistical Learning 読書会 3.4章
domitry
0
350
PCで絵をかこう!
domitry
0
600
JavaScript&可視化講習会#1
domitry
1
710
精神は物理的に記述できるか
domitry
0
180
RubyとFortranの話
domitry
0
400
Nyaplot - a data visualization tool for Ruby
domitry
3
760
D3.js入門
domitry
0
4.5k
3Dプリンタの使用感に関する考察
domitry
1
350
Other Decks in Technology
See All in Technology
re:Inventを楽しむために、 1日1つ「これが楽しみ」を決めよう
beli68
0
120
WasmをRustにする技術
sansantech
PRO
1
130
エンタープライズ事業未経験のデータ屋、 AI時代にN回撃沈する.pdf
ryoskdara_
0
170
[関西Kaggler会 20261113] 続・コミュニティコンペのススメ
nejumi
0
150
AI-Ready なデータ基盤ってなに? & 新卒未経験が、いま考えていること
imuta
0
1k
Datadog の権限統制 〜Org 統合に向けて調べた注意点 / JDDUG-Meetup_24
visional_engineering_and_design
1
200
AIで実装が加速したのに、 なぜ私は仕事の大半で人と話し続けていたのか?
say_no_w
0
200
ノードが消える前提で設計する!Karpenterで金融システムを止めないためのノウハウ大全
daitak
1
160
お風呂場をサーバルームにしよう
yusuke427
0
370
AIエージェントのアーキテクチャ設計
nsatoh
0
320
HTTP通信に使おうとすると実はめんどくさいfile_get_contents
maguroalternative
0
230
変更差分を読むために環境を整備しよう
pipepasta
1
480
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
How to Talk to Developers About Accessibility
jct
2
620
Prompt Engineering for Job Search
mfonobong
0
590
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Practical Orchestrator
shlominoach
192
12k
Designing for Timeless Needs
cassininazir
1
570
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
310
How to train your dragon (web standard)
notwaldorf
96
6.9k
Tell your own story through comics
letsgokoyo
1
1.1k