使用Gnuplot splot与haskell元组列表? [英] Using Gnuplot splot with haskell list of tuples?

查看:146
本文介绍了使用Gnuplot splot与haskell元组列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在haskell中有gnu,并且想要绘制3d曲面。从我的理解,似乎我将不得不建立一个文本文件名data.txt,它有这个

so i have gnu in haskell and want to graph 3d surfaces. From my understanding it seems like i would have to make a text file name data.txt and it having this

1 1 4
1 2 3
1 3 1
1 4 5
2 1 1
2 2 4
2 3 6
2 4 1
3 1 0
3 2 2
3 3 7
3 4 1
4 1 1
4 2 5
4 3 4
4 4 7

然后用线条对数据进行处理。不过,我在haskell中有一个列表,其中包含代表这些点中的每一个的元组。有谁知道我可以如何使我的列表工作,而不是将我的数据以某种方式放入文本文件?

Then doing splot "data" with lines. however, i have a list in haskell, that contains tuples that represent each of these points. Does anyone know how i can make this work with my list rather than putting my data in a text file somehow?

推荐答案

您可以在 documentation

You can see the example given in the documentation:

λ> import Graphics.Gnuplot.Simple
λ> let xs = [-2,-1.8..2::Double] in plotMesh3d [] [] (do x <- xs; return (do y <- xs; return (x,y,cos(x*x+y*y))))

产生这样的结果:

这篇关于使用Gnuplot splot与haskell元组列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆