我正在尝试确定是否可以在 Gadfly 图表上显示基础数据点。我知道我可以显示与特定点关联的标签,但如何在图表本身上显示实际值?
例如,在 Gadfly 文档中,假设我有这个图表:
plot(x=rand(10), y=rand(10))
如何在图表本身上显示 x 和 y 向量的结果值?
最佳答案
实际上,获取字符串表示很容易,例如字符串(3)
。
以下怎么样:
using Gadfly
N = 10
xx = rand(1:10, N) # N random integers between 1 and 10
yy = rand(1:10, N)
labels = map(string, zip(x,y))
plot(x=xx, y=yy, label=labels, Geom.label, Geom.point)
这给出了类似以下内容:
关于julia - Gadfly.jl 在图表上显示实际值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33332297/