Skip to content

Instantly share code, notes, and snippets.

@mrkn
Last active October 14, 2019 14:11
Show Gist options
  • Save mrkn/ba3605601fa696a6eda68dd8fe589a11 to your computer and use it in GitHub Desktop.
Save mrkn/ba3605601fa696a6eda68dd8fe589a11 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
":plotly"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"require 'charty'\n",
"Charty.use_backend(:plotly)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"#<Datasets::Iris:0x00007fd2a0bacf78 @metadata=#<struct Datasets::Metadata id=\"iris\", name=\"Iris\", url=\"https://archive.ics.uci.edu/ml/datasets/Iris\", licenses=nil, description=#<Proc:0x00007fd2a0bacde8@/Users/mrkn/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/red-datasets-0.0.9/lib/datasets/iris.rb:18 (lambda)>>>"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"require 'datasets'\n",
"iris = Datasets::Iris.new"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<script type=\"text/javascript\">\n",
" window.PlotlyConfig = {MathJaxConfig: 'local'};\n",
"\n",
" if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n",
"\n",
" require.config({\n",
" paths: {\n",
" plotly: \"https://cdn.plot.ly/plotly-latest.min\"\n",
" }\n",
" });\n",
"</script>\n"
],
"text/plain": [
"\"<script type=\\\"text/javascript\\\">\\n window.PlotlyConfig = {MathJaxConfig: 'local'};\\n\\n if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \\\"STIX-Web\\\"}});}\\n\\n require.config({\\n paths: {\\n plotly: \\\"https://cdn.plot.ly/plotly-latest.min\\\"\\n }\\n });\\n</script>\\n\""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<div id=\"a5aea764-8647-42a6-a1b6-133ad396603b\" style=\"width: 100%; height:100%;\"></div>\n",
"<script type=\"text/javascript\">\n",
" requirejs([\"plotly\"], function (Plotly) {\n",
" Plotly.newPlot(\"a5aea764-8647-42a6-a1b6-133ad396603b\", [{\"type\":\"box\",\"y\":[5.1,4.9,4.7,4.6,5.0,5.4,4.6,5.0,4.4,4.9,5.4,4.8,4.8,4.3,5.8,5.7,5.4,5.1,5.7,5.1,5.4,5.1,4.6,5.1,4.8,5.0,5.0,5.2,5.2,4.7,4.8,5.4,5.2,5.5,4.9,5.0,5.5,4.9,4.4,5.1,5.0,4.5,4.4,5.0,5.1,4.8,5.1,4.6,5.3,5.0,7.0,6.4,6.9,5.5,6.5,5.7,6.3,4.9,6.6,5.2,5.0,5.9,6.0,6.1,5.6,6.7,5.6,5.8,6.2,5.6,5.9,6.1,6.3,6.1,6.4,6.6,6.8,6.7,6.0,5.7,5.5,5.5,5.8,6.0,5.4,6.0,6.7,6.3,5.6,5.5,5.5,6.1,5.8,5.0,5.6,5.7,5.7,6.2,5.1,5.7,6.3,5.8,7.1,6.3,6.5,7.6,4.9,7.3,6.7,7.2,6.5,6.4,6.8,5.7,5.8,6.4,6.5,7.7,7.7,6.0,6.9,5.6,7.7,6.3,6.7,7.2,6.2,6.1,6.4,7.2,7.4,7.9,6.4,6.3,6.1,7.7,6.3,6.4,6.0,6.9,6.7,6.9,5.8,6.8,6.7,6.7,6.3,6.5,6.2,5.9],\"marker\":{\"color\":\"#4c72b0\"}},{\"type\":\"box\",\"y\":[3.5,3.0,3.2,3.1,3.6,3.9,3.4,3.4,2.9,3.1,3.7,3.4,3.0,3.0,4.0,4.4,3.9,3.5,3.8,3.8,3.4,3.7,3.6,3.3,3.4,3.0,3.4,3.5,3.4,3.2,3.1,3.4,4.1,4.2,3.1,3.2,3.5,3.1,3.0,3.4,3.5,2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.5,4.8,5.4,5.6,5.1,5.1,5.9,5.7,5.2,5.0,5.2,5.4,5.1],\"marker\":{\"color\":\"#55a868\"}},{\"type\":\"box\",\"y\":[0.2,0.2,0.2,0.2,0.2,0.4,0.3,0.2,0.2,0.1,0.2,0.2,0.1,0.1,0.2,0.4,0.4,0.3,0.3,0.3,0.2,0.4,0.2,0.5,0.2,0.2,0.4,0.2,0.2,0.2,0.2,0.4,0.1,0.2,0.1,0.2,0.2,0.1,0.2,0.2,0.3,0.3,0.2,0.6,0.4,0.3,0.2,0.2,0.2,0.2,1.4,1.5,1.5,1.3,1.5,1.3,1.6,1.0,1.3,1.4,1.0,1.5,1.0,1.4,1.3,1.4,1.5,1.0,1.5,1.1,1.8,1.3,1.5,1.2,1.3,1.4,1.4,1.7,1.5,1.0,1.1,1.0,1.2,1.6,1.5,1.6,1.5,1.3,1.3,1.3,1.2,1.4,1.2,1.0,1.3,1.2,1.3,1.3,1.1,1.3,2.5,1.9,2.1,1.8,2.2,2.1,1.7,1.8,1.8,2.5,2.0,1.9,2.1,2.0,2.4,2.3,1.8,2.2,2.3,1.5,2.3,2.0,2.0,1.8,2.1,1.8,1.8,1.8,2.1,1.6,1.9,2.0,2.2,1.5,1.4,2.3,2.4,1.8,1.8,2.1,2.4,2.3,1.9,2.3,2.5,2.3,1.9,2.0,2.3,1.8],\"marker\":{\"color\":\"#c44e52\"}}], {\"showlegend\":false,\"xaxis\":{\"title\":null,\"tickmode\":\"array\",\"tickvals\":[0,1,2,3],\"ticktext\":[\"sepal_length\",\"sepal_width\",\"petal_length\",\"petal_width\"],\"range\":[-0.5,3.5]},\"yaxis\":{\"title\":null}});\n",
" });\n",
"</script>\n"
],
"text/plain": [
"\"<div id=\\\"a5aea764-8647-42a6-a1b6-133ad396603b\\\" style=\\\"width: 100%; height:100%;\\\"></div>\\n<script type=\\\"text/javascript\\\">\\n requirejs([\\\"plotly\\\"], function (Plotly) {\\n Plotly.newPlot(\\\"a5aea764-8647-42a6-a1b6-133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2,0.4,0.3,0.2,0.2,0.1,0.2,0.2,0.1,0.1,0.2,0.4,0.4,0.3,0.3,0.3,0.2,0.4,0.2,0.5,0.2,0.2,0.4,0.2,0.2,0.2,0.2,0.4,0.1,0.2,0.1,0.2,0.2,0.1,0.2,0.2,0.3,0.3,0.2,0.6,0.4,0.3,0.2,0.2,0.2,0.2,1.4,1.5,1.5,1.3,1.5,1.3,1.6,1.0,1.3,1.4,1.0,1.5,1.0,1.4,1.3,1.4,1.5,1.0,1.5,1.1,1.8,1.3,1.5,1.2,1.3,1.4,1.4,1.7,1.5,1.0,1.1,1.0,1.2,1.6,1.5,1.6,1.5,1.3,1.3,1.3,1.2,1.4,1.2,1.0,1.3,1.2,1.3,1.3,1.1,1.3,2.5,1.9,2.1,1.8,2.2,2.1,1.7,1.8,1.8,2.5,2.0,1.9,2.1,2.0,2.4,2.3,1.8,2.2,2.3,1.5,2.3,2.0,2.0,1.8,2.1,1.8,1.8,1.8,2.1,1.6,1.9,2.0,2.2,1.5,1.4,2.3,2.4,1.8,1.8,2.1,2.4,2.3,1.9,2.3,2.5,2.3,1.9,2.0,2.3,1.8],\\\"marker\\\":{\\\"color\\\":\\\"#c44e52\\\"}}], {\\\"showlegend\\\":false,\\\"xaxis\\\":{\\\"title\\\":null,\\\"tickmode\\\":\\\"array\\\",\\\"tickvals\\\":[0,1,2,3],\\\"ticktext\\\":[\\\"sepal_length\\\",\\\"sepal_width\\\",\\\"petal_length\\\",\\\"petal_width\\\"],\\\"range\\\":[-0.5,3.5]},\\\"yaxis\\\":{\\\"title\\\":null}});\\n });\\n</script>\\n\""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig = Charty.box_plot(data: iris)\n",
"fig.render"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div id=\"0dbad5cf-3448-4404-8f8f-eb4a27de3688\" style=\"width: 100%; height:100%;\"></div>\n",
"<script type=\"text/javascript\">\n",
" requirejs([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,4.8,5.0,4.5,3.5,3.8,3.7,3.9,5.1,4.5,4.5,4.7,4.4,4.1,4.0,4.4,4.6,4.0,3.3,4.2,4.2,4.2,4.3,3.0,4.1,6.0,5.1,5.9,5.6,5.8,6.6,4.5,6.3,5.8,6.1,5.1,5.3,5.5,5.0,5.1,5.3,5.5,6.7,6.9,5.0,5.7,4.9,6.7,4.9,5.7,6.0,4.8,4.9,5.6,5.8,6.1,6.4,5.6,5.1,5.6,6.1,5.6,5.5,4.8,5.4,5.6,5.1,5.1,5.9,5.7,5.2,5.0,5.2,5.4,5.1],\"marker\":{\"color\":\"#dd8452\"}}], {\"showlegend\":false,\"xaxis\":{\"title\":null,\"tickmode\":\"array\",\"tickvals\":[0,1],\"ticktext\":[\"sepal_width\",\"petal_length\"],\"range\":[-0.5,1.5]},\"yaxis\":{\"title\":null}});\n",
" });\n",
"</script>\n"
],
"text/plain": [
"\"<div id=\\\"0dbad5cf-3448-4404-8f8f-eb4a27de3688\\\" style=\\\"width: 100%; height:100%;\\\"></div>\\n<script type=\\\"text/javascript\\\">\\n requirejs([\\\"plotly\\\"], function (Plotly) {\\n Plotly.newPlot(\\\"0dbad5cf-3448-4404-8f8f-eb4a27de3688\\\", [{\\\"type\\\":\\\"box\\\",\\\"y\\\":[3.5,3.0,3.2,3.1,3.6,3.9,3.4,3.4,2.9,3.1,3.7,3.4,3.0,3.0,4.0,4.4,3.9,3.5,3.8,3.8,3.4,3.7,3.6,3.3,3.4,3.0,3.4,3.5,3.4,3.2,3.1,3.4,4.1,4.2,3.1,3.2,3.5,3.1,3.0,3.4,3.5,2.3,3.2,3.5,3.8,3.0,3.8,3.2,3.7,3.3,3.2,3.2,3.1,2.3,2.8,2.8,3.3,2.4,2.9,2.7,2.0,3.0,2.2,2.9,2.9,3.1,3.0,2.7,2.2,2.5,3.2,2.8,2.5,2.8,2.9,3.0,2.8,3.0,2.9,2.6,2.4,2.4,2.7,2.7,3.0,3.4,3.1,2.3,3.0,2.5,2.6,3.0,2.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"sepal_width\\\",\\\"petal_length\\\"],\\\"range\\\":[-0.5,1.5]},\\\"yaxis\\\":{\\\"title\\\":null}});\\n });\\n</script>\\n\""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig = Charty.box_plot(data: iris, order: %w[sepal_width petal_length])\n",
"fig.render"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div id=\"6cd5c9ff-d3bb-4b54-b288-5aeb23d54a78\" style=\"width: 100%; height:100%;\"></div>\n",
"<script type=\"text/javascript\">\n",
" requirejs([\"plotly\"], function (Plotly) {\n",
" Plotly.newPlot(\"6cd5c9ff-d3bb-4b54-b288-5aeb23d54a78\", [{\"type\":\"bar\",\"x\":[0,1,2,3],\"y\":[5.843333333333334,3.0540000000000003,3.758666666666666,1.1986666666666668],\"marker\":{\"color\":[\"#4c72b0\",\"#dd8452\",\"#55a868\",\"#c44e52\"]}}], {\"showlegend\":false,\"xaxis\":{\"title\":null,\"tickmode\":\"array\",\"tickvals\":[0,1,2,3],\"ticktext\":[\"sepal_length\",\"sepal_width\",\"petal_length\",\"petal_width\"],\"range\":[-0.5,3.5]},\"yaxis\":{\"title\":null}});\n",
" });\n",
"</script>\n"
],
"text/plain": [
"\"<div id=\\\"6cd5c9ff-d3bb-4b54-b288-5aeb23d54a78\\\" style=\\\"width: 100%; height:100%;\\\"></div>\\n<script type=\\\"text/javascript\\\">\\n requirejs([\\\"plotly\\\"], function (Plotly) {\\n Plotly.newPlot(\\\"6cd5c9ff-d3bb-4b54-b288-5aeb23d54a78\\\", [{\\\"type\\\":\\\"bar\\\",\\\"x\\\":[0,1,2,3],\\\"y\\\":[5.843333333333334,3.0540000000000003,3.758666666666666,1.1986666666666668],\\\"marker\\\":{\\\"color\\\":[\\\"#4c72b0\\\",\\\"#dd8452\\\",\\\"#55a868\\\",\\\"#c44e52\\\"]}}], {\\\"showlegend\\\":false,\\\"xaxis\\\":{\\\"title\\\":null,\\\"tickmode\\\":\\\"array\\\",\\\"tickvals\\\":[0,1,2,3],\\\"ticktext\\\":[\\\"sepal_length\\\",\\\"sepal_width\\\",\\\"petal_length\\\",\\\"petal_width\\\"],\\\"range\\\":[-0.5,3.5]},\\\"yaxis\\\":{\\\"title\\\":null}});\\n });\\n</script>\\n\""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig = Charty.bar_plot(data: iris)\n",
"fig.render"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Ruby 2.6.2",
"language": "ruby",
"name": "ruby"
},
"language_info": {
"file_extension": ".rb",
"mimetype": "application/x-ruby",
"name": "ruby",
"version": "2.6.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment