Gnuplot: plot with circles of a defined radius

南笙酒味 提交于 2020-01-01 04:06:07

问题


I know on gnuplot you can plot some data with circles as the plot points:

plot 'data.txt' using 1:2 ls 1 with circles

How do I then set the size of the circles? I want to plot several sets of data but with different size circles for each data set.


回答1:


If you have a third column in your data, the third column specifies the size of the circles. In your case, you could have the third column have the same value for all the points in each data set. For example:

plot '-' with circles
1 1 0.2
e

will plot a circle at (1,1) with radius 0.2. Note that the radius is in the same units as the data. (The special file name '-' lets you input data directly; typing 'e' ends the input. Type help special at the gnuplot console for more info.)

You can look here for more ideas of how to use circles.




回答2:


I used:

plot "file" using 1:2:($2*0+10) with circles

This will fake a the third column specifying the sizes - it is probably possible to write it simpler, but this worked for me.



来源:https://stackoverflow.com/questions/11747573/gnuplot-plot-with-circles-of-a-defined-radius

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!