Plotrb render 3D scatter like above (rendered function: y=x*x+z*z).
You can rotate and zoom it with your mouse.
My work is based on hlvoorhees's scatter plot demo. (gist here)
Last active
August 29, 2015 13:58
-
-
Save domitry/9956747 to your computer and use it in GitHub Desktop.
3D Scatter demo with Plotrb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'plotrb' | |
values = [] | |
for x in -5..5 | |
for z in -5..5 | |
values.push({x: x, y: (x*x+z*z)/5, z: z}) | |
end | |
end | |
data = pdata.name('data').values(values) | |
mark = rect_mark.from(data) | |
vis = visualization.width(500).height(500) do | |
padding top: 10, left: 30, bottom: 30, right: 10 | |
data data | |
marks mark | |
enable :Plot3D | |
end | |
vis.output_server("3D_scatter") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment