从文件中在gnuplot中绘制球体 [英] plot spheres in gnuplot from file

查看:63
本文介绍了从文件中在gnuplot中绘制球体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含4列(半径,x,y,z)的文件,该文件的每一行都包含一个球体的坐标及其半径.您能帮我在gnuplot中绘制这些球体吗?(如果在gnuplot中无法使用,您可以推荐其他绘图工具吗?)

I have a file with 4 columns (radius,x,y,z) that contains on each line the coordinates of a sphere and its radius. Could you please help me to plot these spheres in gnuplot? ( If it is not possible in gnuplot, could you recommend another plotting tool?)

推荐答案

在2D中有一个带圆圈的样式选项.在3D中,您可以将文件的半径传递给 pointsize 选项.考虑以下数据:

There is a with circles style option in 2D. In 3D you can pass the radius from the file to the pointsize option. Consider the following data:

# 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

然后您可以像这样绘制它( ps pointsize 的缩写,而 pt pointtype 的缩写; pt 7 绘制圆圈):

Then you can plot it like this (ps is short for pointsize and pt is short for pointtype ; pt 7 draws circles):

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

这篇关于从文件中在gnuplot中绘制球体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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