Search code examples
gnuplot

Same increment, same axis length but different x and y ranges in Gnuplot


My test data is given below

# Test data
0.02952 0.00964 6998.41996  0.03072 0.01139 0.04932 0.01484 6998.41996  0.05043 0.01643 0.04709 0.00679 6998.41996  0.04837 0.00871 0.04681 0.00635 6998.41996  0.04805 0.00812 0.0461  0.00527 6998.41996  0.04703 0.0071
0.02993 0.01074 6441.69266  0.03103 0.01222 0.04986 0.01626 6441.69266  0.05087 0.01763 0.04738 0.00769 6441.69266  0.04861 0.00934 0.04714 0.00721 6441.69266  0.04827 0.00871 0.04633 0.00603 6471.42616  0.04722 0.00759
0.03041 0.0119  5929.25325  0.03137 0.0131  0.05054 0.01783 5929.25325  0.05137 0.0189  0.04778 0.00865 5929.25325  0.04888 0.01002 0.04767 0.00838 5929.25325  0.04852 0.00935 0.04663 0.00678 5984.11595  0.04743 0.00811
0.03098 0.01305 5457.57861  0.03175 0.01405 0.05119 0.01936 5457.57861  0.05193 0.02026 0.04819 0.00961 5457.57861  0.04916 0.01073 0.04815 0.00934 5457.57861  0.04878 0.01002 0.04696 0.00755 5533.50109  0.04765 0.00866
0.03163 0.01432 5023.4259   0.03217 0.01505 0.05191 0.02105 5023.4259   0.05254 0.02171 0.04887 0.01063 5023.4259   0.04949 0.0115  0.04859 0.01029 5023.4259   0.04909 0.01075 0.04729 0.00831 5116.81836  0.04791 0.00924
0.032   0.01547 4623.81021  0.03264 0.01612 0.05269 0.02276 4623.81021  0.05323 0.02325 0.04899 0.01155 4623.81021  0.04985 0.01231 0.04908 0.01125 4623.81021  0.04943 0.01151 0.04765 0.00914 4731.51259  0.0482  0.00985
0.03297 0.01698 4255.98413  0.03316 0.01725 0.05409 0.02444 4255.98413  0.05399 0.02488 0.04948 0.01255 4255.98413  0.05025 0.01317 0.04962 0.01216 4255.98413  0.04981 0.01233 0.04804 0.00988 4375.22105  0.04851 0.0105
0.03336 0.0181  3917.41877  0.03374 0.01845 0.05454 0.02638 3917.41877  0.05485 0.0266  0.05022 0.01364 3917.41877  0.0507  0.01408 0.04997 0.01295 3917.41877  0.05023 0.01319 0.04856 0.01078 4045.75892  0.04886 0.01119
0.03424 0.01958 3605.78643  0.03439 0.01973 0.05554 0.02842 3605.78643  0.0558  0.02843 0.05083 0.01471 3605.78643  0.0512  0.01504 0.05059 0.01395 3605.78643  0.0507  0.0141  0.04901 0.01167 3741.10588  0.04925 0.01191
0.03516 0.02102 3318.94458  0.03511 0.02107 0.05675 0.03035 3318.94458  0.05685 0.03036 0.05153 0.01581 3318.94458  0.05175 0.01607 0.0513  0.015   3318.94458  0.05123 0.01506 0.04953 0.01258 3459.39378  0.04967 0.01267
0.03612 0.02247 3054.92111  0.03592 0.02249 0.05834 0.03203 3054.92111  0.05804 0.0324  0.05235 0.01697 3054.92111  0.05237 0.01714 0.05186 0.01617 3054.92111  0.05181 0.01608 0.05011 0.01353 3191.53786  0.05014 0.01346
0.03718 0.02411 2811.90083  0.0368  0.02397 0.05955 0.03468 2811.90083  0.05935 0.03452 0.05319 0.01818 2811.90083  0.05305 0.01827 0.05253 0.01711 2811.90083  0.05246 0.01715 0.05074 0.01439 2951.20923  0.05066 0.01429
0.03818 0.02559 2588.21292  0.0378  0.02553 0.06121 0.03693 2588.21292  0.0608  0.03675 0.0541  0.01946 2588.21292  0.0538  0.01945 0.05362 0.01833 2588.21292  0.05319 0.01826 0.05143 0.01534 2728.97778  0.05124 0.01517
0.03942 0.02723 2382.31947  0.0389  0.02716 0.06298 0.0393  2382.31947  0.06241 0.03908 0.05507 0.0207  2382.31947  0.05464 0.02068 0.05413 0.01937 2382.31947  0.054   0.01942 0.05213 0.01622 2523.48077  0.05187 0.01607
0.04078 0.02895 2192.80494  0.04011 0.02885 0.06494 0.04169 2192.80494  0.06421 0.04149 0.05607 0.02198 2192.80494  0.05557 0.02196 0.05514 0.02056 2192.80494  0.05489 0.02062 0.05291 0.01718 2333.45806  0.05258 0.017
0.04239 0.03073 2018.36636  0.04146 0.03061 0.06707 0.04418 2018.36636  0.06618 0.04399 0.05722 0.02328 2018.36636  0.0566  0.02329 0.05643 0.02189 2018.36636  0.05588 0.02187 0.05377 0.01821 2157.74441  0.05335 0.01797
0.0442  0.03265 1853.53162  0.04294 0.03242 0.06911 0.04671 1853.53162  0.06837 0.04657 0.05849 0.02461 1853.53162  0.05773 0.02466 0.05743 0.02311 1853.53162  0.05698 0.02315 0.05474 0.01921 1995.26231  0.0542  0.01895
0.04562 0.03421 1706.08239  0.04458 0.03427 0.07185 0.04927 1706.08239  0.07076 0.04919 0.0598  0.02593 1706.08239  0.05897 0.02607 0.05862 0.02425 1706.08239  0.05818 0.02446 0.05574 0.02015 1845.01542  0.05513 0.01997
0.04744 0.03597 1570.3628   0.04638 0.03617 0.07448 0.05177 1570.3628   0.0734  0.05187 0.06122 0.02739 1570.3628   0.06034 0.02751 0.06    0.02549 1570.3628   0.0595  0.02579 0.05679 0.0212  1706.08239  0.05615 0.021
0.04951 0.03782 1445.43977  0.04834 0.03809 0.07739 0.05433 1445.43977  0.07627 0.05457 0.0627  0.02867 1445.43977  0.06182 0.02896 0.06152 0.0269  1445.43977  0.06095 0.02713 0.05799 0.02222 1577.61127  0.05724 0.02204
0.05171 0.03966 1330.45442  0.05049 0.04004 0.08065 0.05713 1330.45442  0.0794  0.05729 0.06437 0.03012 1330.45442  0.06346 0.03042 0.06314 0.02807 1330.45442  0.06253 0.02847 0.05928 0.02328 1458.81426  0.05845 0.02307
0.05393 0.04128 1224.6162   0.05282 0.04197 0.08413 0.05955 1224.6162   0.08281 0.05998 0.06618 0.03152 1224.6162   0.06522 0.03189 0.06527 0.02944 1224.6162   0.06425 0.0298  0.05972 0.0236  1348.96288  0.05974 0.02411
0.05666 0.04317 1127.19746  0.05535 0.04388 0.08748 0.06138 1127.19746  0.08648 0.06263 0.06816 0.03281 1127.19746  0.06713 0.03333 0.0667  0.03056 1127.19746  0.0661  0.0311  0.06175 0.0251  1247.38351  0.06115 0.02513
0.05932 0.04509 1037.52842  0.05806 0.04574 0.0918  0.06524 1037.52842  0.09043 0.06519 0.07027 0.03414 1037.52842  0.06919 0.03475 0.06888 0.03189 1037.52842  0.06808 0.03237 0.06353 0.02603 1153.45326  0.06264 0.02612
0.06225 0.04668 954.99259   0.06097 0.04755 0.09596 0.06681 954.99259   0.09464 0.06766 0.07236 0.03541 954.99259   0.07138 0.03612 0.07082 0.03292 954.99259   0.0702  0.03356 0.06505 0.02698 1066.59612  0.06424 0.02708
0.06517 0.04821 879.02252   0.06406 0.04928 0.09993 0.06878 879.02252   0.09912 0.06999 0.07457 0.03664 879.02252   0.07372 0.03743 0.07297 0.03389 879.02252   0.07245 0.03469 0.06674 0.02784 986.27949   0.06594 0.02798
0.06837 0.04967 809.0959    0.06735 0.05089 0.10443 0.07091 809.0959    0.10381 0.07214 0.07697 0.03779 809.0959    0.0762  0.03866 0.07543 0.03496 809.0959    0.07482 0.03572 0.06848 0.02859 912.01084   0.06773 0.02882
0.07145 0.05112 744.73197   0.0708  0.05238 0.10997 0.07277 744.73197   0.10884 0.07409 0.07931 0.03914 744.73197   0.07881 0.03979 0.07775 0.03589 744.73197   0.07731 0.03665 0.07015 0.02913 841.39514   0.06961 0.0296
0.07514 0.0525  685.48823   0.0744  0.05371 0.11398 0.07457 685.48823   0.11398 0.07582 0.08213 0.03987 685.48823   0.08153 0.04082 0.08056 0.03682 685.48823   0.0799  0.03745 0.07214 0.02995 778.03655   0.07157 0.03029
0.07846 0.05346 630.95734   0.07815 0.05487 0.11808 0.07749 630.95734   0.11932 0.07729 0.08473 0.04055 630.95734   0.08435 0.04171 0.08311 0.03766 630.95734   0.08256 0.03813 0.07413 0.03059 719.44898   0.0736  0.0309
0.08225 0.05446 580.76442   0.08201 0.05585 0.12414 0.07791 580.76442   0.12476 0.07848 0.08766 0.0415  580.76442   0.08727 0.04247 0.08574 0.0383  580.76442   0.08529 0.03865 0.0762  0.03098 665.27316   0.0757  0.03139
0.08615 0.05561 534.56436   0.08596 0.05663 0.1301  0.07893 534.56436   0.1304  0.07938 0.0904  0.04235 534.56436   0.09025 0.04308 0.08814 0.0389  534.56436   0.08806 0.03903 0.07831 0.03146 615.17687   0.07784 0.03178
0.09021 0.05617 492.03954   0.08997 0.05719 0.13544 0.07942 492.03954   0.13605 0.07998 0.0935  0.04295 492.03954   0.09328 0.04354 0.09105 0.03915 492.03954   0.09086 0.03925 0.08017 0.03178 568.85293   0.08001 0.03206
0.09373 0.05673 452.89758   0.09401 0.05754 0.14396 0.08375 452.89758   0.1417  0.08028 0.09647 0.04343 452.89758   0.09634 0.04384 0.09419 0.03944 452.89758   0.09366 0.03932 0.08222 0.03207 526.01727   0.08221 0.03221
0.09803 0.0571  416.86938   0.09806 0.05769 0.14663 0.07984 416.86938   0.14735 0.08028 0.0993  0.04338 416.86938   0.0994  0.04399 0.09673 0.03943 416.86938   0.09644 0.03923 0.08449 0.03232 486.40721   0.08439 0.03225
0.10197 0.05731 383.70725   0.10209 0.05762 0.15125 0.0799  383.70725   0.15289 0.07998 0.10242 0.0438  383.70725   0.10243 0.04398 0.09912 0.03957 383.70725   0.09918 0.03901 0.08301 0.02946 449.77985   0.08658 0.03218
0.10566 0.05509 353.18317   0.10607 0.05736 0.16665 0.08047 353.18317   0.15844 0.07941 0.10607 0.04421 353.18317   0.10545 0.04381 0.10172 0.04029 353.18317   0.10186 0.03865 0.08819 0.03179 415.91061   0.08874 0.032
0.10997 0.05691 325.0873    0.10997 0.05691 0.16141 0.08017 325.0873    0.16378 0.07859 0.10833 0.04355 325.0873    0.10843 0.04353 0.10484 0.03917 325.0873    0.10443 0.03817 0.09017 0.03157 384.59178   0.09085 0.03171
0.11377 0.05691 299.22646   0.11377 0.05628 0.16922 0.07903 299.22646   0.16901 0.07754 0.11202 0.04329 299.22646   0.11131 0.04311 0.10689 0.03842 299.22646   0.10699 0.03758 0.09266 0.03127 355.63132   0.09292 0.03133
0.11767 0.05615 275.42287   0.11747 0.05551 0.17353 0.07787 275.42287   0.17394 0.07631 0.11398 0.04274 275.42287   0.11408 0.04257 0.10946 0.03774 275.42287   0.10946 0.03689 0.09476 0.03164 328.85163   0.09491 0.03085
0.12168 0.05538 253.51286   0.12096 0.05461 0.17846 0.07675 253.51286   0.17877 0.07491 0.11634 0.0429  253.51286   0.11675 0.04195 0.11285 0.03736 253.51286   0.11172 0.03613 0.09679 0.03081 304.0885    0.09684 0.0303
0.12517 0.05473 232.80913   0.12435 0.0536  0.18431 0.07453 232.80913   0.18339 0.07337 0.11952 0.04162 232.80913   0.11942 0.04123 0.11428 0.0362  232.80913   0.11398 0.03531 0.09834 0.0299  281.19008   0.09869 0.02967
0.12845 0.05358 214.28906   0.12763 0.0525  0.18503 0.07043 214.28906   0.1878  0.07172 0.1226  0.04084 214.28906   0.12188 0.04046 0.11716 0.03502 214.28906   0.11603 0.03444 0.09968 0.02942 260.01596   0.10045 0.029
0.13205 0.05237 197.24227   0.13071 0.05134 0.1915  0.07037 197.24227   0.19191 0.07    0.12394 0.03993 197.24227   0.12424 0.03963 0.1189  0.03488 197.24227   0.11798 0.03355 0.10139 0.02871 239.88329   0.10213 0.02829
0.13585 0.05077 181.55157   0.13359 0.05014 0.19592 0.06969 181.55157   0.19592 0.06824 0.12732 0.03886 181.55157   0.1265  0.03878 0.11849 0.03304 181.55157   0.11983 0.03263 0.10381 0.0279  221.81964   0.10371 0.02753
0.13831 0.05007 167.10906   0.13636 0.04892 0.19889 0.06667 167.10906   0.19961 0.06647 0.12999 0.03829 167.10906   0.12866 0.03791 0.12147 0.03146 167.10906   0.12157 0.03172 0.10566 0.02702 205.11622   0.10525 0.02676
0.14303 0.04758 153.81546   0.13903 0.04769 0.20177 0.06753 153.81546   0.2031  0.06469 0.13112 0.03896 153.81546   0.13071 0.03704 0.12342 0.03227 153.81546   0.12322 0.0308  0.10792 0.02548 189.67059   0.10658 0.02598
0.14355 0.04769 141.57938   0.14149 0.04647 0.2107  0.06523 141.57938   0.20639 0.06295 0.13379 0.03653 141.57938   0.13256 0.03616 0.12383 0.02983 141.57938   0.12476 0.02992 0.10956 0.02459 175.38805   0.10792 0.02519
0.14653 0.04559 130.31668   0.14386 0.04528 0.21265 0.05532 130.31668   0.20947 0.06125 0.13687 0.03557 130.31668   0.13441 0.03531 0.12774 0.02789 130.31668   0.1263  0.02906 0.10915 0.02405 162.18101   0.10925 0.0244
0.1493  0.04481 119.94993   0.14601 0.04412 0.21173 0.0577  119.94993   0.21245 0.05962 0.13862 0.03374 119.94993   0.13616 0.03449 0.12589 0.02592 119.94993   0.12763 0.02823 0.11747 0.02416 149.96848   0.11038 0.02363

Gnuplot script is given below

##
##
#
reset session 
##
##
set terminal postscript eps enhanced colour font 'Times-Bold,12' size 4in,4in  
set output "test.eps"

set style line 6 lt 6 lw 5 lc rgb "#000FF"
set xtics out scale 1.5 
set ytics out scale 1.5
set tics font ", 16"
set xlabel "{/Times-Italic Z}_{Re} (m{/Symbol \127}. cm^{-2})"  font ",16"
set ylabel "{/Times-Italic -Z}_{Im} (m{/Symbol \127}. cm^{-2})" font ",16"
set key spacing 1.15 font ",14" width -1.0 

set xtics 20 
set ytics 20
set yrange [0:100] 
set key inside left top 

plot [0:220] 'test.dat' u ($1*1000):($2*1000) w points pt 4 ps 1.50 lt -1 title "-1.40 V", \
'' u ($6*1000):($7*1000) w points pt 6 ps 1.50 lt -1 title "-1.25 V", \
'' u ($11*1000):($12*1000) w points pt 8 ps 1.50 lt -1 title "-1.20 V", \
'' u ($16*1000):($17*1000) w points pt 10 ps 1.50 lt -1 title "-1.10 V", \
'' u ($21*1000):($22*1000) w points pt 12 ps 1.50 lt -1 title "-1.00 V", \
'test.dat' u ($4*1000):($5*1000) w l ls 6 title "Fit", \
'' u ($9*1000):($10*1000) w l ls 6 notitle, \
'' u ($14*1000):($15*1000) w l ls 6 notitle, \
'' u ($19*1000):($20*1000) w l ls 6 notitle, \
'' u ($24*1000):($25*1000) w l ls 6 notitle, \
'test.dat' u ($1*1000):($2*1000):(sprintf("%.0f",$3)) every 25::24 w labels offset 0,-1.75 boxed notitle, \
'' u ($6*1000):($7*1000):(sprintf("%.0f",$8)) every 25::24 w labels offset 0,-1.75 boxed notitle, \
'' u ($11*1000):($12*1000):(sprintf("%.0f",$13)) every 25::24 w labels offset 0,-1.75 boxed notitle, \
'' u ($16*1000):($17*1000):(sprintf("%.0f",$18)) every 25::24 w labels offset 0,-1.75 boxed notitle, \
'' u ($21*1000):($22*1000):(sprintf("%.0f",$23)) every 25::24 w labels offset 0,-1.75 boxed notitle, \
# 

Plotting is ok but I wish to have the same length of axis for 0 to 20 in both x and y axis. That is, although the increment of xtics and ytics is same, the length is not same. Since this is one of the requirements of plotting complex impedance data, any suggestions would be helpful. Thanks,


Solution

  • You set the yrange to [0:100]. And your plotting the xrange [0:220]. First, I would set the xrange via

    set xrange[0:220]
    

    And add the line

    set size ratio -1
    

    Check help size.

    ...The meaning of a negative value for is different. If =-1, gnuplot tries to set the scales so that the unit has the same length on both the x and y axes.