从文件中绘制gnuplot中的球体

时间:2014-06-04 10:47:10

标签: plot gnuplot

我有一个包含4列(半径,x,y,z)的文件,每行包含一个球体的坐标及其半径。你能帮我在gnuplot中绘制这些球吗? (如果在gnuplot中不可能,你能推荐另一种绘图工具吗?)

1 个答案:

答案 0 :(得分:4)

2D中有with circles样式选项。在3D中,您可以将半径从文件传递到pointsize选项。请考虑以下数据:

# radius, x, y, z
1 0 0 0
2 1 2 2
3 3 4 5
1 2 5 7
1 1 3 4
2 2 0 1

然后您可以这样绘制(pspointsize的缩写,ptpointtype的缩写; pt 7绘制圆圈):

splot "data" u 2:3:4:1 ps variable pt 7

enter image description here