与gnuplot

时间:2015-09-25 16:30:53

标签: gnuplot polar-coordinates

让我们考虑以下gnuplot代码:

set term pdf
set output 'wrong.pdf'

set size ratio 1
set tmargin at screen 0.92
set bmargin at screen 0.08

set style line 11 linewidth 1 linecolor rgb 'gray80'
set polar
set angle degree

unset grid
set grid polar 45

# START ----------------------
r = 10000
set rrange [0:r]
set rtics 2000 format '' scale 0
# END ------------------------

unset border
unset xtics
unset ytics
set ytics axis nomirror scale 0 offset 0.3 2000,2000,10000

unset raxis

FILE = "FILE_matrix.dat"
plot FILE using 1:2 with lines lw 3 lc rgb "red" notitle

文件' FILE_matrix.dat'是(抱歉,但很长)

   0.0000000e+00    4.0447050e+03
   1.0000000e+00    4.3570910e+03
   2.0000000e+00    4.6628463e+03
   3.0000000e+00    4.9602826e+03
   4.0000000e+00    5.2477346e+03
   5.0000000e+00    5.5235684e+03
   6.0000000e+00    5.7861896e+03
   7.0000000e+00    6.0340515e+03
   8.0000000e+00    6.2656631e+03
   9.0000000e+00    6.4795963e+03
   1.0000000e+01    6.6744937e+03
   1.1000000e+01    6.8490752e+03
   1.2000000e+01    7.0021450e+03
   1.3000000e+01    7.1325975e+03
   1.4000000e+01    7.2394233e+03
   1.5000000e+01    7.3217146e+03
   1.6000000e+01    7.3786700e+03
   1.7000000e+01    7.4095991e+03
   1.8000000e+01    7.4139260e+03
   1.9000000e+01    7.3911929e+03
   2.0000000e+01    7.3410629e+03
   2.1000000e+01    7.2633220e+03
   2.2000000e+01    7.1578807e+03
   2.3000000e+01    7.0247752e+03
   2.4000000e+01    6.8641677e+03
   2.5000000e+01    6.6763462e+03
   2.6000000e+01    6.4617236e+03
   2.7000000e+01    6.2208365e+03
   2.8000000e+01    5.9543430e+03
   2.9000000e+01    5.6630203e+03
   3.0000000e+01    5.3477615e+03
   3.1000000e+01    5.0095718e+03
   3.2000000e+01    4.6495644e+03
   3.3000000e+01    4.2689555e+03
   3.4000000e+01    3.8690592e+03
   3.5000000e+01    3.4512819e+03
   3.6000000e+01    3.0171157e+03
   3.7000000e+01    2.5681321e+03
   3.8000000e+01    2.1059751e+03
   3.9000000e+01    1.6323535e+03
   4.0000000e+01    1.1490335e+03
   4.1000000e+01    6.5783052e+02
   4.2000000e+01    1.6060141e+02
   4.3000000e+01   -3.4076432e+02
   4.4000000e+01   -8.4435291e+02
   4.5000000e+01   -1.3482350e+03
   4.6000000e+01   -1.8504745e+03
   4.7000000e+01   -2.3491372e+03
   4.8000000e+01   -2.8422999e+03
   4.9000000e+01   -3.3280587e+03
   5.0000000e+01   -3.8045381e+03
   5.1000000e+01   -4.2698992e+03
   5.2000000e+01   -4.7223485e+03
   5.3000000e+01   -5.1601455e+03
   5.4000000e+01   -5.5816110e+03
   5.5000000e+01   -5.9851348e+03
   5.6000000e+01   -6.3691827e+03
   5.7000000e+01   -6.7323034e+03
   5.8000000e+01   -7.0731356e+03
   5.9000000e+01   -7.3904135e+03
   6.0000000e+01   -7.6829730e+03
   6.1000000e+01   -7.9497565e+03
   6.2000000e+01   -8.1898179e+03
   6.3000000e+01   -8.4023265e+03
   6.4000000e+01   -8.5865710e+03
   6.5000000e+01   -8.7419621e+03
   6.6000000e+01   -8.8680355e+03
   6.7000000e+01   -8.9644534e+03
   6.8000000e+01   -9.0310061e+03
   6.9000000e+01   -9.0676126e+03
   7.0000000e+01   -9.0743204e+03
   7.1000000e+01   -9.0513056e+03
   7.2000000e+01   -8.9988713e+03
   7.3000000e+01   -8.9174460e+03
   7.4000000e+01   -8.8075814e+03
   7.5000000e+01   -8.6699496e+03
   7.6000000e+01   -8.5053392e+03
   7.7000000e+01   -8.3146521e+03
   7.8000000e+01   -8.0988982e+03
   7.9000000e+01   -7.8591907e+03
   8.0000000e+01   -7.5967407e+03
   8.1000000e+01   -7.3128514e+03
   8.2000000e+01   -7.0089110e+03
   8.3000000e+01   -6.6863867e+03
   8.4000000e+01   -6.3468172e+03
   8.5000000e+01   -5.9918055e+03
   8.6000000e+01   -5.6230107e+03
   8.7000000e+01   -5.2421405e+03
   8.8000000e+01   -4.8509425e+03
   8.9000000e+01   -4.4511964e+03
   9.0000000e+01   -4.0447050e+03
   9.1000000e+01   -3.6332858e+03
   9.2000000e+01   -3.2187621e+03
   9.3000000e+01   -2.8029549e+03
   9.4000000e+01   -2.3876737e+03
   9.5000000e+01   -1.9747082e+03
   9.6000000e+01   -1.5658198e+03
   9.7000000e+01   -1.1627333e+03
   9.8000000e+01   -7.6712907e+02
   9.9000000e+01   -3.8063477e+02
   1.0000000e+02   -4.8181781e+00
   1.0100000e+02    3.5882028e+02
   1.0200000e+02    7.0885436e+02
   1.0300000e+02    1.0439385e+03
   1.0400000e+02    1.3628141e+03
   1.0500000e+02    1.6643150e+03
   1.0600000e+02    1.9473726e+03
   1.0700000e+02    2.2110211e+03
   1.0800000e+02    2.4544011e+03
   1.0900000e+02    2.6767635e+03
   1.1000000e+02    2.8774728e+03
   1.1100000e+02    3.0560094e+03
   1.1200000e+02    3.2119715e+03
   1.1300000e+02    3.3450770e+03
   1.1400000e+02    3.4551636e+03
   1.1500000e+02    3.5421895e+03
   1.1600000e+02    3.6062328e+03
   1.1700000e+02    3.6474906e+03
   1.1800000e+02    3.6662772e+03
   1.1900000e+02    3.6630223e+03
   1.2000000e+02    3.6382680e+03
   1.2100000e+02    3.5926655e+03
   1.2200000e+02    3.5269716e+03
   1.2300000e+02    3.4420439e+03
   1.2400000e+02    3.3388363e+03
   1.2500000e+02    3.2183937e+03
   1.2600000e+02    3.0818459e+03
   1.2700000e+02    2.9304019e+03
   1.2800000e+02    2.7653431e+03
   1.2900000e+02    2.5880163e+03
   1.3000000e+02    2.3998267e+03
   1.3100000e+02    2.2022304e+03
   1.3200000e+02    1.9967263e+03
   1.3300000e+02    1.7848485e+03
   1.3400000e+02    1.5681582e+03
   1.3500000e+02    1.3482350e+03
   1.3600000e+02    1.1266692e+03
   1.3700000e+02    9.0505304e+02
   1.3800000e+02    6.8497219e+02
   1.3900000e+02    4.6799776e+02
   1.4000000e+02    2.5567784e+02
   1.4100000e+02    4.9529389e+01
   1.4200000e+02   -1.4896973e+02
   1.4300000e+02   -3.3838854e+02
   1.4400000e+02   -5.1735049e+02
   1.4500000e+02   -6.8454068e+02
   1.4600000e+02   -8.3871285e+02
   1.4700000e+02   -9.7869597e+02
   1.4800000e+02   -1.1034004e+03
   1.4900000e+02   -1.2118238e+03
   1.5000000e+02   -1.3030565e+03
   1.5100000e+02   -1.3762861e+03
   1.5200000e+02   -1.4308023e+03
   1.5300000e+02   -1.4660005e+03
   1.5400000e+02   -1.4813855e+03
   1.5500000e+02   -1.4765737e+03
   1.5600000e+02   -1.4512959e+03
   1.5700000e+02   -1.4053988e+03
   1.5800000e+02   -1.3388461e+03
   1.5900000e+02   -1.2517188e+03
   1.6000000e+02   -1.1442153e+03
   1.6100000e+02   -1.0166508e+03
   1.6200000e+02   -8.6945577e+02
   1.6300000e+02   -7.0317421e+02
   1.6400000e+02   -5.1846121e+02
   1.6500000e+02   -3.1607995e+02
   1.6600000e+02   -9.6898123e+01
   1.6700000e+02    1.3811613e+02
   1.6800000e+02    3.8789881e+02
   1.6900000e+02    6.5129517e+02
   1.7000000e+02    9.2706524e+02
   1.7100000e+02    1.2138898e+03
   1.7200000e+02    1.5103769e+03
   1.7300000e+02    1.8150685e+03
   1.7400000e+02    2.1264474e+03
   1.7500000e+02    2.4429453e+03
   1.7600000e+02    2.7629498e+03
   1.7700000e+02    3.0848128e+03
   1.7800000e+02    3.4068584e+03
   1.7900000e+02    3.7273912e+03
   1.8000000e+02    4.0447050e+03
   1.8100000e+02    4.3570910e+03
   1.8200000e+02    4.6628463e+03
   1.8300000e+02    4.9602826e+03
   1.8400000e+02    5.2477346e+03
   1.8500000e+02    5.5235684e+03
   1.8600000e+02    5.7861896e+03
   1.8700000e+02    6.0340515e+03
   1.8800000e+02    6.2656631e+03
   1.8900000e+02    6.4795963e+03
   1.9000000e+02    6.6744937e+03
   1.9100000e+02    6.8490752e+03
   1.9200000e+02    7.0021450e+03
   1.9300000e+02    7.1325975e+03
   1.9400000e+02    7.2394233e+03
   1.9500000e+02    7.3217146e+03
   1.9600000e+02    7.3786700e+03
   1.9700000e+02    7.4095991e+03
   1.9800000e+02    7.4139260e+03
   1.9900000e+02    7.3911929e+03
   2.0000000e+02    7.3410629e+03
   2.0100000e+02    7.2633220e+03
   2.0200000e+02    7.1578807e+03
   2.0300000e+02    7.0247752e+03
   2.0400000e+02    6.8641677e+03
   2.0500000e+02    6.6763462e+03
   2.0600000e+02    6.4617236e+03
   2.0700000e+02    6.2208365e+03
   2.0800000e+02    5.9543430e+03
   2.0900000e+02    5.6630203e+03
   2.1000000e+02    5.3477615e+03
   2.1100000e+02    5.0095718e+03
   2.1200000e+02    4.6495644e+03
   2.1300000e+02    4.2689555e+03
   2.1400000e+02    3.8690592e+03
   2.1500000e+02    3.4512819e+03
   2.1600000e+02    3.0171157e+03
   2.1700000e+02    2.5681321e+03
   2.1800000e+02    2.1059751e+03
   2.1900000e+02    1.6323535e+03
   2.2000000e+02    1.1490335e+03
   2.2100000e+02    6.5783052e+02
   2.2200000e+02    1.6060141e+02
   2.2300000e+02   -3.4076432e+02
   2.2400000e+02   -8.4435291e+02
   2.2500000e+02   -1.3482350e+03
   2.2600000e+02   -1.8504745e+03
   2.2700000e+02   -2.3491372e+03
   2.2800000e+02   -2.8422999e+03
   2.2900000e+02   -3.3280587e+03
   2.3000000e+02   -3.8045381e+03
   2.3100000e+02   -4.2698992e+03
   2.3200000e+02   -4.7223485e+03
   2.3300000e+02   -5.1601455e+03
   2.3400000e+02   -5.5816110e+03
   2.3500000e+02   -5.9851348e+03
   2.3600000e+02   -6.3691827e+03
   2.3700000e+02   -6.7323034e+03
   2.3800000e+02   -7.0731356e+03
   2.3900000e+02   -7.3904135e+03
   2.4000000e+02   -7.6829730e+03
   2.4100000e+02   -7.9497565e+03
   2.4200000e+02   -8.1898179e+03
   2.4300000e+02   -8.4023265e+03
   2.4400000e+02   -8.5865710e+03
   2.4500000e+02   -8.7419621e+03
   2.4600000e+02   -8.8680355e+03
   2.4700000e+02   -8.9644534e+03
   2.4800000e+02   -9.0310061e+03
   2.4900000e+02   -9.0676126e+03
   2.5000000e+02   -9.0743204e+03
   2.5100000e+02   -9.0513056e+03
   2.5200000e+02   -8.9988713e+03
   2.5300000e+02   -8.9174460e+03
   2.5400000e+02   -8.8075814e+03
   2.5500000e+02   -8.6699496e+03
   2.5600000e+02   -8.5053392e+03
   2.5700000e+02   -8.3146521e+03
   2.5800000e+02   -8.0988982e+03
   2.5900000e+02   -7.8591907e+03
   2.6000000e+02   -7.5967407e+03
   2.6100000e+02   -7.3128514e+03
   2.6200000e+02   -7.0089110e+03
   2.6300000e+02   -6.6863867e+03
   2.6400000e+02   -6.3468172e+03
   2.6500000e+02   -5.9918055e+03
   2.6600000e+02   -5.6230107e+03
   2.6700000e+02   -5.2421405e+03
   2.6800000e+02   -4.8509425e+03
   2.6900000e+02   -4.4511964e+03
   2.7000000e+02   -4.0447050e+03
   2.7100000e+02   -3.6332858e+03
   2.7200000e+02   -3.2187621e+03
   2.7300000e+02   -2.8029549e+03
   2.7400000e+02   -2.3876737e+03
   2.7500000e+02   -1.9747082e+03
   2.7600000e+02   -1.5658198e+03
   2.7700000e+02   -1.1627333e+03
   2.7800000e+02   -7.6712907e+02
   2.7900000e+02   -3.8063477e+02
   2.8000000e+02   -4.8181781e+00
   2.8100000e+02    3.5882028e+02
   2.8200000e+02    7.0885436e+02
   2.8300000e+02    1.0439385e+03
   2.8400000e+02    1.3628141e+03
   2.8500000e+02    1.6643150e+03
   2.8600000e+02    1.9473726e+03
   2.8700000e+02    2.2110211e+03
   2.8800000e+02    2.4544011e+03
   2.8900000e+02    2.6767635e+03
   2.9000000e+02    2.8774728e+03
   2.9100000e+02    3.0560094e+03
   2.9200000e+02    3.2119715e+03
   2.9300000e+02    3.3450770e+03
   2.9400000e+02    3.4551636e+03
   2.9500000e+02    3.5421895e+03
   2.9600000e+02    3.6062328e+03
   2.9700000e+02    3.6474906e+03
   2.9800000e+02    3.6662772e+03
   2.9900000e+02    3.6630223e+03
   3.0000000e+02    3.6382680e+03
   3.0100000e+02    3.5926655e+03
   3.0200000e+02    3.5269716e+03
   3.0300000e+02    3.4420439e+03
   3.0400000e+02    3.3388363e+03
   3.0500000e+02    3.2183937e+03
   3.0600000e+02    3.0818459e+03
   3.0700000e+02    2.9304019e+03
   3.0800000e+02    2.7653431e+03
   3.0900000e+02    2.5880163e+03
   3.1000000e+02    2.3998267e+03
   3.1100000e+02    2.2022304e+03
   3.1200000e+02    1.9967263e+03
   3.1300000e+02    1.7848485e+03
   3.1400000e+02    1.5681582e+03
   3.1500000e+02    1.3482350e+03
   3.1600000e+02    1.1266692e+03
   3.1700000e+02    9.0505304e+02
   3.1800000e+02    6.8497219e+02
   3.1900000e+02    4.6799776e+02
   3.2000000e+02    2.5567784e+02
   3.2100000e+02    4.9529389e+01
   3.2200000e+02   -1.4896973e+02
   3.2300000e+02   -3.3838854e+02
   3.2400000e+02   -5.1735049e+02
   3.2500000e+02   -6.8454068e+02
   3.2600000e+02   -8.3871285e+02
   3.2700000e+02   -9.7869597e+02
   3.2800000e+02   -1.1034004e+03
   3.2900000e+02   -1.2118238e+03
   3.3000000e+02   -1.3030565e+03
   3.3100000e+02   -1.3762861e+03
   3.3200000e+02   -1.4308023e+03
   3.3300000e+02   -1.4660005e+03
   3.3400000e+02   -1.4813855e+03
   3.3500000e+02   -1.4765737e+03
   3.3600000e+02   -1.4512959e+03
   3.3700000e+02   -1.4053988e+03
   3.3800000e+02   -1.3388461e+03
   3.3900000e+02   -1.2517188e+03
   3.4000000e+02   -1.1442153e+03
   3.4100000e+02   -1.0166508e+03
   3.4200000e+02   -8.6945577e+02
   3.4300000e+02   -7.0317421e+02
   3.4400000e+02   -5.1846121e+02
   3.4500000e+02   -3.1607995e+02
   3.4600000e+02   -9.6898123e+01
   3.4700000e+02    1.3811613e+02
   3.4800000e+02    3.8789881e+02
   3.4900000e+02    6.5129517e+02
   3.5000000e+02    9.2706524e+02
   3.5100000e+02    1.2138898e+03
   3.5200000e+02    1.5103769e+03
   3.5300000e+02    1.8150685e+03
   3.5400000e+02    2.1264474e+03
   3.5500000e+02    2.4429453e+03
   3.5600000e+02    2.7629498e+03
   3.5700000e+02    3.0848128e+03
   3.5800000e+02    3.4068584e+03
   3.5900000e+02    3.7273912e+03
   3.6000000e+02    4.0447050e+03

如果定义了r,则代码返回一个错误的极坐标图。要查看这些内容,您必须在STARTEND之间对代码进行评论。

编辑1

我的gnuplot是5.0 patchlevel 0.

编辑2

enter image description here 这是我对上述代码的输出。

2 个答案:

答案 0 :(得分:0)

使用Gnuplot 5.0补丁级别0(右侧面板)

似乎没问题,但是没有使用例如4.6补丁级别4(左侧面板)

4.6 5.0

答案 1 :(得分:0)

数据第二列中的负数似乎会造成麻烦,因此您需要绘制它的绝对值,abs($2)

plot FILE using 1:(abs($2))

在我们设置gnuplot之后,rrange的行为让我感到震惊。这可能是一个错误(?)