gnuplot:数据中定义的半径与生成的绘图不同

问题描述 投票:0回答:1

这个脚本曾经给我正确的情节,现在它不......如果我运行这个脚本:

$DATA<<EOD
0.00,0.00,0.7000,90.0000,114.0000
0.00,0.00,1.0000,114.0000,162.0000
0.00,0.00,1.0000,162.0000,234.0000
0.00,0.00,1.0000,234.0000,330.0000
0.00,0.00,1.0000,330.0000,450.0000
EOD
set datafile separator comma
set style data circles
set term windows
unset xtics; unset ytics; unset x2tics; unset y2tics
set grid noxtics
set grid noytics
set xrange [-1.5:1.5]
set yrange [-1.5:1.5]
set border 0
set colorsequence classic
set title "{/Tahoma=22 Plotting with Pies}" textcolor rgb "0xE25822" rotate by 0
set key inside top right opaque fc rgb "0xFFFFFF"
set label 1 "Alpha\n1" at -0.27,1.27 center font "Tahoma:Bold,12" front
set label 2 "Bravo\n2" at -0.97,0.87 center font "Tahoma:Bold,12" front
set label 3 "Charlie\n3" at -1.24,-0.40 center font "Tahoma:Bold,12" front
set label 4 "Delta\n4" at 0.27,-1.27 center font "Tahoma:Bold,12" front
set label 5 "Echo\n5" at 1.13,0.65 center font "Tahoma:Bold,12" front
plot $DATA every ::0::0 using 1:2:3:4:5 with circles fillstyle solid fc rgb "0x007FFF" title "Alpha (6.67%)",\
$DATA every ::1::1 using 1:2:3:4:5 with circles fillstyle solid fc rgb "0x3CD070" title "Bravo (13.33%)",\
$DATA every ::2::2 using 1:2:3:4:5 with circles fillstyle solid fc rgb "0x738678" title "Charlie (20.00%)",\
$DATA every ::3::3 using 1:2:3:4:5 with circles fillstyle solid fc rgb "0xE25822" title "Delta (26.67%)",\
$DATA every ::4::4 using 1:2:3:4:5 with circles fillstyle pattern 4 title "Echo (33.33%)"

我得到这样的情节:

请注意,在图中,我在“Alpha”部分的顶部有十字线,我得到的读数为 0.0024,1.011(给定或接受)

我的问题是:如果我的数据显示 Alpha 为 0.7,其余部分为 1.0,为什么我的绘图中得到的半径为 1(对于 Alpha)和 1.4(对于其余部分)。

PS:标签的位置看起来也不稳定,但我想一次解决一个问题。

谢谢你, 罗伯托

gnuplot
1个回答
0
投票

gnuplot 中圆的半径始终根据其 x 轴坐标范围指定。如果 x 轴和 y 轴具有不同的比例,则该圆的垂直范围将是不同的。来自文档:

gnuplot> help circle
    

 Syntax:
     set object <index> circle {at|center} <position> size <radius>
         {arc [<begin>:<end>]} {no{wedge}}
         {<other-object-properties>}

 The position of the circle is specified by giving the position of the center
 center followed by the radius.  The keywords `at` and `center` are synonyms.
 In 2D plots the position and radius may be given in any coordinate system.
 See `coordinates`. Circles in 3D plots cannot use graph coordinates.
 In all cases the radius is calculated relative to the horizontal scale of the
 axis, graph, or canvas.  Any disparity between the horizontal and vertical
 scaling will be corrected for so that the result is always a circle.
 If you want to draw a circle in plot coordinates (such that it will appear as
 an ellipse if the horizontal and vertical scales are different), use
 `set object ellipse` instead.
© www.soinside.com 2019 - 2024. All rights reserved.