我尝试使用以下代码:
require 'statsample'
include Statsample::Shorthand
n = 100
x = rnorm(n)
y = x + rnorm(n,0.5,0.2)
Statsample::Graph::Scatterplot.new(x,y)我得到的输出如下:
#<Statsample::Graph::Scatterplot:0x00000003b7cac0 @v2_name=nil, @v1_name=nil, @v1=#<Daru::Vector(100)>
0 -0.8253230853299456
1 1.5602776553658153
2 1.7155337260438381
3 0.9898130381171576
4 0.17150928493368836有人能解释一下我犯了什么错误吗?
发布于 2017-04-13 16:35:26
在您要链接的示例中,有一些javascript代码似乎使用https://github.com/domitry/Nyaplotjs来绘制图形。
ruby代码只提供散点图的坐标数据,而不是实际绘制的东西。
https://stackoverflow.com/questions/43386259
复制相似问题