gnuplot 未在圆的 y 轴上显示正确的比例

gnuplot not showing correct scale on y axis for a circle

我正在使用 gnuplot 对图形问题建模

我正在使用以下命令用 gnuplot 绘制圆圈

set xtics 1
set ytics 1
plot 'circles.txt' with circle

我的circles.txt包含以下数据

0 0 3

这个圆的最高点(圆心在原点,半径为 3 )应该是 (0,3) 但它在这个图中显示为 (0,2)

我该如何纠正这个错误?

用圆圈绘图是为了将 绘制为圆圈,因此无论坐标轴缩放如何,它们都是圆的。正如 gnuplot 文档中指出的那样,

The radius is always interpreted in the units of the plot's horizontal axis (x or x2). The scale on y and the aspect ratio of the plot are both ignored.

您可以绘制 with ellipses;来自 plot with ellipses 的文档:

  2 columns: x y
  3 columns: x y major_diam
  4 columns: x y major_diam minor_diam
  5 columns: x y major_diam minor_diam angle

所以你将其绘制为

plot 'circles.txt' using 1:2:(*2):(*2) with ellipses

(椭圆使用直径,所以尺寸应该是第三列的两倍)

set object ellipse:

 set object ellipse at 0, 0 size 6, 6