Skip to content

Instantly share code, notes, and snippets.

@hafen
Created October 7, 2015 05:04
Show Gist options
  • Save hafen/3505fd3aaded31332088 to your computer and use it in GitHub Desktop.
Save hafen/3505fd3aaded31332088 to your computer and use it in GitHub Desktop.
NYC Taxi Manhattan Passenger Number Distribution
figure(ylab = "# passengers") %>% 
 ly_points(fval, q, data = pc_quant)
<!DOCTYPE html>
<html>
<head>
<script src="http://cdn.pydata.org/bokeh/release/bokeh-0.10.0.min.js"></script>
<link href="http://cdn.pydata.org/bokeh/release/bokeh-0.10.0.min.css" rel="stylesheet">
</head>
<body>
<div id="c124eec5d77efb59a89befb109961fd9" class="plotdiv"></div>
<script type="text/javascript">
Bokeh.$(function() {
var modelid = "09d867fcd51c78ef3c6e4e255979a2fc";
var modeltype = "Plot";
var elementid = "c124eec5d77efb59a89befb109961fd9";
Bokeh.logger.info("Realizing plot:");
Bokeh.logger.info(" - modeltype: Plot");
Bokeh.logger.info(" - modelid: 09d867fcd51c78ef3c6e4e255979a2fc");
Bokeh.logger.info(" - elementid: c124eec5d77efb59a89befb109961fd9");
var all_models = [{"type":"Plot","id":"09d867fcd51c78ef3c6e4e255979a2fc","attributes":{"title":null,"id":"09d867fcd51c78ef3c6e4e255979a2fc","plot_width":470,"plot_height":474,"x_range":{"type":"Range1d","id":"23ede58c732a9c5737d093ff9da0e695"},"y_range":{"type":"Range1d","id":"7ea6f9f784c32371478d4a957efc1d65"},"left":[{"type":"LinearAxis","id":"01e5921aedf0fe937b5c1c50b68d12c8"}],"below":[{"type":"LinearAxis","id":"06a47bedcb645bfdd1ed5c7daa6f0db4"}],"right":[],"above":[],"renderers":[{"type":"GlyphRenderer","id":"6477783265e01d76c4d0de9e734821d0"},{"type":"LinearAxis","id":"06a47bedcb645bfdd1ed5c7daa6f0db4"},{"type":"Grid","id":"c9ae7eb58cf55f96537a550322e6b959"},{"type":"LinearAxis","id":"01e5921aedf0fe937b5c1c50b68d12c8"},{"type":"Grid","id":"4e054b6fbd03daf9f223610c3d87778e"}],"tools":[{"type":"PanTool","id":"534bb0410b29c8f096a8396aeb6945d0"},{"type":"WheelZoomTool","id":"1c951d4ec1522889a084087fb87e6b80"},{"type":"BoxZoomTool","id":"414514d456229069cacb62fb57300f97"},{"type":"ResizeTool","id":"9e7dc68d5f83c8f62b5c0b07e405fc58"},{"type":"ResetTool","id":"e4ce46b4b165a479c4949af01c5faec3"},{"type":"PreviewSaveTool","id":"e0e9651f57b5d8370a05318b61b789bd"},{"type":"HelpTool","id":"0e7f21955df95c153809c22d01328168"}],"tool_events":{"type":"ToolEvents","id":"af437b494d9b65302c7d313c874625da"},"extra_y_ranges":{},"extra_x_ranges":{},"tags":[],"doc":null,"min_border":4,"lod_threshold":null},"subtype":"Figure"},{"type":"PanTool","id":"534bb0410b29c8f096a8396aeb6945d0","attributes":{"id":"534bb0410b29c8f096a8396aeb6945d0","tags":[],"doc":null,"plot":{"type":"Plot","id":"09d867fcd51c78ef3c6e4e255979a2fc","subtype":"Figure"},"dimensions":["width","height"]}},{"type":"ToolEvents","id":"af437b494d9b65302c7d313c874625da","attributes":{"id":"af437b494d9b65302c7d313c874625da","tags":[],"doc":null},"geometries":[]},{"type":"WheelZoomTool","id":"1c951d4ec1522889a084087fb87e6b80","attributes":{"id":"1c951d4ec1522889a084087fb87e6b80","tags":[],"doc":null,"plot":{"type":"Plot","id":"09d867fcd51c78ef3c6e4e255979a2fc","subtype":"Figure"},"dimensions":["width","height"]}},{"type":"BoxZoomTool","id":"414514d456229069cacb62fb57300f97","attributes":{"id":"414514d456229069cacb62fb57300f97","tags":[],"doc":null,"plot":{"type":"Plot","id":"09d867fcd51c78ef3c6e4e255979a2fc","subtype":"Figure"}}},{"type":"ResizeTool","id":"9e7dc68d5f83c8f62b5c0b07e405fc58","attributes":{"id":"9e7dc68d5f83c8f62b5c0b07e405fc58","tags":[],"doc":null,"plot":{"type":"Plot","id":"09d867fcd51c78ef3c6e4e255979a2fc","subtype":"Figure"}}},{"type":"ResetTool","id":"e4ce46b4b165a479c4949af01c5faec3","attributes":{"id":"e4ce46b4b165a479c4949af01c5faec3","tags":[],"doc":null,"plot":{"type":"Plot","id":"09d867fcd51c78ef3c6e4e255979a2fc","subtype":"Figure"}}},{"type":"PreviewSaveTool","id":"e0e9651f57b5d8370a05318b61b789bd","attributes":{"id":"e0e9651f57b5d8370a05318b61b789bd","tags":[],"doc":null,"plot":{"type":"Plot","id":"09d867fcd51c78ef3c6e4e255979a2fc","subtype":"Figure"}}},{"type":"HelpTool","id":"0e7f21955df95c153809c22d01328168","attributes":{"id":"0e7f21955df95c153809c22d01328168","tags":[],"doc":null,"plot":{"type":"Plot","id":"09d867fcd51c78ef3c6e4e255979a2fc","subtype":"Figure"},"redirect":["http://hafen.github.io/rbokeh"],"help_tooltip":["Click to learn more about rbokeh."]}},{"type":"ColumnDataSource","id":"53b78b89068a77e4f7b71eb6d63ddbc7","attributes":{"id":"53b78b89068a77e4f7b71eb6d63ddbc7","tags":[],"doc":null,"column_names":["x","y"],"selected":[],"discrete_ranges":{},"cont_ranges":{},"data":{"x":[0,0.005,0.01,0.015,0.02,0.025,0.03,0.035,0.04,0.045,0.05,0.055,0.06,0.065,0.07,0.075,0.08,0.085,0.09,0.095,0.1,0.105,0.11,0.115,0.12,0.125,0.13,0.135,0.14,0.145,0.15,0.155,0.16,0.165,0.17,0.175,0.18,0.185,0.19,0.195,0.2,0.205,0.21,0.215,0.22,0.225,0.23,0.235,0.24,0.245,0.25,0.255,0.26,0.265,0.27,0.275,0.28,0.285,0.29,0.295,0.3,0.305,0.31,0.315,0.32,0.325,0.33,0.335,0.34,0.345,0.35,0.355,0.36,0.365,0.37,0.375,0.38,0.385,0.39,0.395,0.4,0.405,0.41,0.415,0.42,0.425,0.43,0.435,0.44,0.445,0.45,0.455,0.46,0.465,0.47,0.475,0.48,0.485,0.49,0.495,0.5,0.505,0.51,0.515,0.52,0.525,0.53,0.535,0.54,0.545,0.55,0.555,0.56,0.565,0.57,0.575,0.58,0.585,0.59,0.595,0.6,0.605,0.61,0.615,0.62,0.625,0.63,0.635,0.64,0.645,0.65,0.655,0.66,0.665,0.67,0.675,0.68,0.685,0.69,0.695,0.7,0.705,0.71,0.715,0.72,0.725,0.73,0.735,0.74,0.745,0.75,0.755,0.76,0.765,0.77,0.775,0.78,0.785,0.79,0.795,0.8,0.805,0.81,0.815,0.82,0.825,0.83,0.835,0.84,0.845,0.85,0.855,0.86,0.865,0.87,0.875,0.88,0.885,0.89,0.895,0.9,0.905,0.91,0.915,0.92,0.925,0.93,0.935,0.94,0.945,0.95,0.955,0.96,0.965,0.97,0.975,0.98,0.985,0.99,0.995,1],"y":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,2.0001,3.0002,3.0002,3.0002,3.0002,3.0002,3.0002,3.0002,3.0002,3.0002,3.9998,3.9998,3.9998,3.9998,4.9999,4.9999,4.9999,4.9999,4.9999,4.9999,4.9999,4.9999,4.9999,4.9999,4.9999,4.9999,6,6,6,6,6,6,6,6]}}},{"type":"Circle","id":"4771819859c34c443bfd5871de034271","attributes":{"id":"4771819859c34c443bfd5871de034271","tags":[],"doc":null,"size":{"units":"screen","value":10},"line_color":{"units":"data","value":"#1F77B4"},"fill_color":{"units":"data","value":"#1F77B4"},"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Circle","id":"f2d18bceaf51ef1df20f5740e9527a35","attributes":{"id":"f2d18bceaf51ef1df20f5740e9527a35","tags":[],"doc":null,"size":{"units":"screen","value":10},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"},"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"GlyphRenderer","id":"6477783265e01d76c4d0de9e734821d0","attributes":{"id":"6477783265e01d76c4d0de9e734821d0","tags":[],"doc":null,"selection_glyph":null,"nonselection_glyph":{"type":"Circle","id":"f2d18bceaf51ef1df20f5740e9527a35"},"server_data_source":null,"name":null,"data_source":{"type":"ColumnDataSource","id":"53b78b89068a77e4f7b71eb6d63ddbc7"},"glyph":{"type":"Circle","id":"4771819859c34c443bfd5871de034271"}}},{"type":"Range1d","id":"23ede58c732a9c5737d093ff9da0e695","attributes":{"id":"23ede58c732a9c5737d093ff9da0e695","tags":[],"doc":null,"start":-0.07,"end":1.07}},{"type":"Range1d","id":"7ea6f9f784c32371478d4a957efc1d65","attributes":{"id":"7ea6f9f784c32371478d4a957efc1d65","tags":[],"doc":null,"start":0.65,"end":6.35}},{"type":"LinearAxis","id":"06a47bedcb645bfdd1ed5c7daa6f0db4","attributes":{"id":"06a47bedcb645bfdd1ed5c7daa6f0db4","tags":[],"doc":null,"plot":{"type":"Plot","id":"09d867fcd51c78ef3c6e4e255979a2fc","subtype":"Figure"},"axis_label":"fval","formatter":{"type":"BasicTickFormatter","id":"fcff247ecdb44519e2b2fc63e4add999"},"ticker":{"type":"BasicTicker","id":"76a076966485d3c630198b2b37b6fae0"},"visible":true,"axis_label_text_font_size":"12pt"}},{"type":"BasicTickFormatter","id":"fcff247ecdb44519e2b2fc63e4add999","attributes":{"id":"fcff247ecdb44519e2b2fc63e4add999","tags":[],"doc":null}},{"type":"BasicTicker","id":"76a076966485d3c630198b2b37b6fae0","attributes":{"id":"76a076966485d3c630198b2b37b6fae0","tags":[],"doc":null,"num_minor_ticks":5}},{"type":"Grid","id":"c9ae7eb58cf55f96537a550322e6b959","attributes":{"id":"c9ae7eb58cf55f96537a550322e6b959","tags":[],"doc":null,"dimension":0,"plot":{"type":"Plot","id":"09d867fcd51c78ef3c6e4e255979a2fc","subtype":"Figure"},"ticker":{"type":"BasicTicker","id":"76a076966485d3c630198b2b37b6fae0"}}},{"type":"LinearAxis","id":"01e5921aedf0fe937b5c1c50b68d12c8","attributes":{"id":"01e5921aedf0fe937b5c1c50b68d12c8","tags":[],"doc":null,"plot":{"type":"Plot","id":"09d867fcd51c78ef3c6e4e255979a2fc","subtype":"Figure"},"axis_label":"# passengers","formatter":{"type":"BasicTickFormatter","id":"bd647627371067063c85ddc0ffc5fa1a"},"ticker":{"type":"BasicTicker","id":"7b34fa4c20a1e785ce80e52e2388352b"},"visible":true,"axis_label_text_font_size":"12pt"}},{"type":"BasicTickFormatter","id":"bd647627371067063c85ddc0ffc5fa1a","attributes":{"id":"bd647627371067063c85ddc0ffc5fa1a","tags":[],"doc":null}},{"type":"BasicTicker","id":"7b34fa4c20a1e785ce80e52e2388352b","attributes":{"id":"7b34fa4c20a1e785ce80e52e2388352b","tags":[],"doc":null,"num_minor_ticks":5}},{"type":"Grid","id":"4e054b6fbd03daf9f223610c3d87778e","attributes":{"id":"4e054b6fbd03daf9f223610c3d87778e","tags":[],"doc":null,"dimension":1,"plot":{"type":"Plot","id":"09d867fcd51c78ef3c6e4e255979a2fc","subtype":"Figure"},"ticker":{"type":"BasicTicker","id":"7b34fa4c20a1e785ce80e52e2388352b"}}}];
Bokeh.load_models(all_models);
var model = Bokeh.Collections(modeltype).get(modelid);
var view = new model.default_view({model: model, el: '#c124eec5d77efb59a89befb109961fd9'});
Bokeh.index[modelid] = view;
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment