Skip to content

Instantly share code, notes, and snippets.

@statsmaths
Created December 29, 2013 20:36
Show Gist options
  • Save statsmaths/8174529 to your computer and use it in GitHub Desktop.
Save statsmaths/8174529 to your computer and use it in GitHub Desktop.
Plot
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://ramnathv.github.io/rCharts/libraries/widgets/polycharts/js/polychart2.standalone.js' type='text/javascript'></script>
<style>
.rChart {
display: block;
margin-left: auto;
margin-right: auto;
width: 800px;
height: 400px;
}
</style>
</head>
<body>
<div id='chart53036f5d951' class='rChart polycharts'></div>
<script type='text/javascript'>
var chartParams = {
"dom": "chart53036f5d951",
"width": 800,
"height": 400,
"layers": [
{
"x": "y",
"y": "x",
"data": {
"x": [ -0.30898, 1.9457, 0.67016, -0.96633, -0.18502, 0.46518, -0.24104, -1.5918, -0.01106, 0.67295, -0.32558, -0.86174, -1.7654, -1.1247, 0.99965, -0.021048, -1.2571, 0.47299, 1.626, -0.25898, 0.16047, -0.20176, -0.12712, -0.10967, -0.3492, 0.023835, 1.1765, -0.62588, 0.17895, -1.1382, -0.89961, -0.23233, -0.47243, -0.90116, -0.7278, 1.5046, -1.1149, -0.1795, 1.5587, -0.019378, -1.5541, 0.83231, -0.96172, -0.83434, -1.1594, -0.88264, 0.29995, 0.31559, 0.25155, -1.9608, 1.317, 0.47519, 0.73568, -0.53451, 1.8125, 0.53551, 0.90928, 0.5232, 0.34506, 0.88791, 0.63867, -0.49269, 0.90875, -0.64815, -1.9349, -0.47272, 1.4461, 0.3115, -1.2616, 1.3949, 0.37574, 0.53524, -0.23704, 0.38594, -0.78199, -1.5453, -2.0185, -3.8252, -0.71185, 0.66547, 0.24607, -1.2577, -0.79853, 0.20152, -0.81445, -0.80064, 0.18019, 0.0668, -0.92839, 1.3354, -0.60376, 0.54622, 0.16174, -0.22296, -0.74481, -0.70031, -0.37189, 0.31127, 1.3507, -1.5001 ],
"y": [ 0.74482, -0.094334, -0.81432, -1.0979, -0.17512, -2.1671, -1.1858, 0.25815, 0.45771, 0.48151, 0.59004, 0.12344, -0.04642, 0.00012092, -1.2132, -0.12871, -0.3589, -0.18107, -0.41371, 0.95583, 0.83924, 1.3945, 2.151, -1.1596, -0.28459, 0.976, 0.58369, 1.6662, 0.19978, 0.016554, 1.0304, 0.98474, 0.15253, -0.036514, 0.8625, -0.098923, 0.25314, -0.41302, 0.62855, -0.34426, -1.6781, -0.29713, 1.6914, -0.8, -1.0312, 0.66706, -2.0491, 0.64348, 0.085746, -1.4561, -0.62692, 0.30688, -0.84632, -0.56273, 1.1111, 0.24701, -0.16199, 0.51969, 0.30457, -0.58345, 1.7282, -0.33931, -1.3182, -1.1024, -1.7796, 0.80865, -0.44031, -0.17418, 1.9638, -0.3529, -0.7444, 0.55254, -3.2657, -1.0357, -1.0223, -2.1103, -0.40537, 1.2113, -0.58041, -1.7231, 0.21494, 0.72501, -0.18462, 0.80461, 1.487, 0.0085484, 0.87244, 0.18742, 1.2346, 0.58052, -1.3817, -1.8156, 1.1906, 1.0068, 1.6744, 0.10267, 1.0601, -0.2158, 0.54892, -1.524 ],
"name": [ "e", "y", "v", "u", "a", "n", "w", "j", "w", "x", "m", "d", "p", "v", "h", "d", "v", "p", "b", "h", "m", "x", "g", "h", "e", "g", "h", "k", "t", "j", "l", "f", "o", "t", "n", "q", "y", "r", "u", "w", "c", "e", "a", "x", "g", "s", "j", "m", "v", "i", "d", "m", "a", "m", "i", "d", "z", "x", "r", "o", "j", "n", "y", "p", "y", "k", "l", "f", "v", "x", "r", "i", "e", "t", "f", "r", "r", "t", "c", "v", "g", "t", "p", "g", "d", "e", "w", "d", "r", "u", "s", "x", "z", "o", "t", "j", "n", "o", "e", "n" ]
},
"facet": null,
"type": "point",
"size": {
"const": 2
},
"color": {
"const": "#888"
},
"tooltip": "function(item){return item.x}"
},
{
"data": {
"x": [ 0.42081, 0.67799, -0.54616, 0.53907, 1.4893, 1.3289, 0.89176, -0.59704, 2.222, 0.75738, -0.087766, 1.607, -0.078674, -0.17111, 1.8755, -0.79639, 1.0673, -0.47097, -0.56968, -0.73829, 2.5827, -0.26916, 0.14715, 0.86582, 1.4131, -1.0745, 0.62796, 0.40576, -0.68733, 0.57649, 1.3245, 0.72416, -1.5127, 0.41506, -0.19851, 0.56424, 0.33074, -0.1089, -0.64031, 0.49338, -0.001703, -2.1746, -1.1798, -0.8327, -0.11195, 0.10012, -0.47722, -0.14853, 1.2966, 0.87238, -0.88809, 0.37382, -0.55659, -0.62538, 0.13036, -0.12097, -1.7004, 0.011885, 0.22332, -0.40729, -1.3735, -0.56548, -1.9859, -0.6433, 0.94209, -0.93809, 0.6939, 1.0044, -1.06, -0.83405, 1.0102, -1.3769, 0.059275, -1.6167, 0.54765, -2.1289, 0.21957, -1.4009, -0.61593, 0.38949, 1.5864, -2.0586, -1.5249, -0.69692, 0.60344, -0.31692, 0.60638, -1.325, -1.1885, 1.3003, -1.4507, -0.65742, 0.84763, 0.34175, -0.055797, 0.95652, 0.54667, 1.3346, -0.88893, 0.8517 ],
"y": [ 0.20464, 2.0498, -1.234, -0.99838, -0.60774, 0.43059, -1.4895, -0.11405, 1.1532, 0.68949, 0.011711, -2.056, 1.4546, -0.75612, -0.43263, -1.0776, -1.8263, -0.39575, -0.66054, -0.33528, -0.068145, -0.32076, 1.2456, -0.32578, -1.0949, -0.029969, -2.9271, -1.3362, -0.64571, -0.0058753, 1.1638, 0.65838, -0.013517, 0.5172, 0.62623, -0.41607, 0.10058, -0.29447, 0.42657, 0.57809, 0.91766, 1.9005, -0.55326, -0.53184, 0.58257, 1.3534, 1.1341, -1.4125, 0.5108, 1.5013, -1.3574, 0.38161, -0.31342, -1.6456, -0.3281, 0.19582, -0.14185, 1.8038, 0.74869, -1.4184, 0.2771, -1.5371, 0.3551, 1.4177, 0.72008, -1.6159, 0.44919, 3.0456, -0.66065, 1.6888, 1.2113, -1.1584, -0.59894, -0.43273, 0.21345, 2.0915, 0.61467, 0.39973, -0.70719, 1.3001, -0.12952, -0.95417, -1.2117, 0.36529, 0.55623, 1.3444, 0.11789, 0.18507, -0.83832, -0.90667, 0.63581, -1.5601, 0.84653, -0.16307, -0.6539, 1.821, -2.4965, -0.69889, 1.6311, 0.55107 ],
"name": [ "l", "v", "j", "s", "y", "k", "s", "c", "o", "z", "b", "p", "k", "l", "q", "f", "z", "p", "z", "m", "y", "z", "p", "r", "t", "b", "f", "k", "a", "d", "c", "h", "u", "s", "s", "b", "q", "e", "y", "q", "q", "j", "n", "d", "o", "a", "d", "r", "x", "t", "v", "g", "x", "v", "p", "g", "v", "t", "o", "q", "b", "m", "v", "x", "m", "m", "x", "j", "f", "f", "v", "u", "x", "n", "q", "r", "v", "i", "d", "v", "n", "f", "r", "d", "s", "p", "z", "r", "j", "b", "k", "p", "a", "w", "g", "d", "x", "f", "r", "h" ]
},
"type": "line",
"color": {
"const": "blue"
},
"tooltip": null,
"x": "y",
"y": "x",
"facet": null,
"size": {
"const": 2
}
}
],
"facet": [],
"guides": [],
"coord": [],
"id": "chart53036f5d951"
}
_.each(chartParams.layers, function(el){
el.data = polyjs.data(el.data)
})
var graph_chart53036f5d951 = polyjs.chart(chartParams);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment