0

I am trying to plot 3d data as a surface plot. However the result is not the one I would like to obtain.

Here is the code:

\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}

\begin{document}
\begin{tikzpicture}
   \begin{axis} [
      view={-37.5}{30},
   ]
      \addplot3 [
      surf,
      z buffer=sort,
      mesh/rows=17,
      ] file {input-file.txt}; 
   \end{axis} 
\end{tikzpicture}

\end{document}

and these are the points I am using (file input-file.txt):

0.34    0.6 0.16784845236609
0.34    0.599039264020162   0.449340944725675
0.34    0.596193976625564   1.10126818451041
0.34    0.591573480615127   1.45934780647924
0.34    0.585355339059327   1.0246427812154
0.34    0.57777851165098    0.571065984297396
0.34    0.569134171618255   1.07623712852824
0.34    0.559754516100807   1.12465629098543
0.34    0.55    0.787500509369331
0.34    0.540245483899194   1.12015409939905
0.34    0.530865828381746   1.13259283140334
0.34    0.52222148834902    0.568492686096429
0.34    0.514644660940673   1.10089553976541
0.34    0.508426519384873   1.5714479856616
0.34    0.503806023374436   1.22657729591635
0.34    0.500960735979838   0.513403122109212
0.34    0.5 0.169436938727958
0.339231411216129   0.6 0.181945862374656
0.339231411216129   0.599039264020162   0.415596394227327
0.339231411216129   0.596193976625564   1.05905994097856
0.339231411216129   0.591573480615127   1.35089764646065
0.339231411216129   0.585355339059327   1.02142540815158
0.339231411216129   0.57777851165098    0.525248744530274
0.339231411216129   0.569134171618255   1.08086679483286
0.339231411216129   0.559754516100807   1.07774810506582
0.339231411216129   0.55    0.775245573056729
0.339231411216129   0.540245483899194   1.10645466417185
0.339231411216129   0.530865828381746   1.12132946945134
0.339231411216129   0.52222148834902    0.572233527727084
0.339231411216129   0.514644660940673   1.08280074332495
0.339231411216129   0.508426519384873   1.55214263040998
0.339231411216129   0.503806023374436   1.20536251342408
0.339231411216129   0.500960735979838   0.498414219839597
0.339231411216129   0.5 0.167746004932493
0.336955181300451   0.6 0.212283753077523
0.336955181300451   0.599039264020162   0.409885790877354
0.336955181300451   0.596193976625564   1.06414855662836
0.336955181300451   0.591573480615127   1.36645840364238
0.336955181300451   0.585355339059327   0.984877000623279
0.336955181300451   0.57777851165098    0.491421587678596
0.336955181300451   0.569134171618255   1.06777824295722
0.336955181300451   0.559754516100807   1.12418525713356
0.336955181300451   0.55    0.784602078301413
0.336955181300451   0.540245483899194   1.09206305863632
0.336955181300451   0.530865828381746   1.12727171271332
0.336955181300451   0.52222148834902    0.541731176102686
0.336955181300451   0.514644660940673   1.03952020298478
0.336955181300451   0.508426519384873   1.51952420499077
0.336955181300451   0.503806023374436   1.17198988017635
0.336955181300451   0.500960735979838   0.442130587671382
0.336955181300451   0.5 0.221774604774455
0.333258784492102   0.6 0.312285861882379
0.333258784492102   0.599039264020162   0.42503343537243
0.333258784492102   0.596193976625564   0.990297876119652
0.333258784492102   0.591573480615127   1.33413426793052
0.333258784492102   0.585355339059327   0.96516568266834
0.333258784492102   0.57777851165098    0.495854140923719
0.333258784492102   0.569134171618255   1.07228658024174
0.333258784492102   0.559754516100807   1.07288962919032
0.333258784492102   0.55    0.724455943668244
0.333258784492102   0.540245483899194   1.07068402091054
0.333258784492102   0.530865828381746   1.11917038784505
0.333258784492102   0.52222148834902    0.54030779515551
0.333258784492102   0.514644660940673   0.997412760947773
0.333258784492102   0.508426519384873   1.45170577137429
0.333258784492102   0.503806023374436   1.12414009899353
0.333258784492102   0.500960735979838   0.424631468557648
0.333258784492102   0.5 0.281566454647853
0.328284271247462   0.6 0.329847433585048
0.328284271247462   0.599039264020162   0.381346622013918
0.328284271247462   0.596193976625564   0.960273175695715
0.328284271247462   0.591573480615127   1.29613617387869
0.328284271247462   0.585355339059327   0.871775672948957
0.328284271247462   0.57777851165098    0.498028320569001
0.328284271247462   0.569134171618255   1.07072459288508
0.328284271247462   0.559754516100807   1.01598563042696
0.328284271247462   0.55    0.691416261644992
0.328284271247462   0.540245483899194   1.07070232866336
0.328284271247462   0.530865828381746   1.13633474309056
0.328284271247462   0.52222148834902    0.550861688867378
0.328284271247462   0.514644660940673   0.924789199432766
0.328284271247462   0.508426519384873   1.40148215743844
0.328284271247462   0.503806023374436   1.05394264113778
0.328284271247462   0.500960735979838   0.40554546445666
0.328284271247462   0.5 0.321686888290928
0.322222809320784   0.6 0.291794738476832
0.322222809320784   0.599039264020162   0.274778892414575
0.322222809320784   0.596193976625564   0.866368467767339
0.322222809320784   0.591573480615127   1.20616050203607
0.322222809320784   0.585355339059327   0.793127053028286
0.322222809320784   0.57777851165098    0.442873368795027
0.322222809320784   0.569134171618255   1.03454064882765
0.322222809320784   0.559754516100807   1.00263797226301
0.322222809320784   0.55    0.536100587119758
0.322222809320784   0.540245483899194   1.02776376341676
0.322222809320784   0.530865828381746   1.12736214019333
0.322222809320784   0.52222148834902    0.479008749684451
0.322222809320784   0.514644660940673   0.850122169064344
0.322222809320784   0.508426519384873   1.31519882849557
0.322222809320784   0.503806023374436   0.984899656772529
0.322222809320784   0.500960735979838   0.31170791251163
0.322222809320784   0.5 0.294043483954587
0.315307337294604   0.6 0.290065509559609
0.315307337294604   0.599039264020162   0.204407946531863
0.315307337294604   0.596193976625564   0.820385699287654
0.315307337294604   0.591573480615127   1.14250364958085
0.315307337294604   0.585355339059327   0.679366993535661
0.315307337294604   0.57777851165098    0.360217997744986
0.315307337294604   0.569134171618255   1.03393466884543
0.315307337294604   0.559754516100807   0.934730955481913
0.315307337294604   0.55    0.416637103599256
0.315307337294604   0.540245483899194   0.980483954201829
0.315307337294604   0.530865828381746   1.11128299512125
0.315307337294604   0.52222148834902    0.40416217557239
0.315307337294604   0.514644660940673   0.779413790511384
0.315307337294604   0.508426519384873   1.23769397491902
0.315307337294604   0.503806023374436   0.926623314326271
0.315307337294604   0.500960735979838   0.236752663272866
0.315307337294604   0.5 0.314215436564376
0.307803612880645   0.6 0.388434626408841
0.307803612880645   0.599039264020162   0.270934070087601
0.307803612880645   0.596193976625564   0.785548352566943
0.307803612880645   0.591573480615127   1.10222484290624
0.307803612880645   0.585355339059327   0.690361306098708
0.307803612880645   0.57777851165098    0.324529589458168
0.307803612880645   0.569134171618255   1.03493080767063
0.307803612880645   0.559754516100807   0.883088216080198
0.307803612880645   0.55    0.19739835908319
0.307803612880645   0.540245483899194   0.915794927340698
0.307803612880645   0.530865828381746   1.09029092632625
0.307803612880645   0.52222148834902    0.385369821046505
0.307803612880645   0.514644660940673   0.721328880566321
0.307803612880645   0.508426519384873   1.24057982361344
0.307803612880645   0.503806023374436   0.884152329618988
0.307803612880645   0.500960735979838   0.302742138918163
0.307803612880645   0.5 0.407438103749515
0.3 0.6 0.422340001400054
0.3 0.599039264020162   0.321241075782776
0.3 0.596193976625564   0.785112926910731
0.3 0.591573480615127   1.09863958699267
0.3 0.585355339059327   0.684696456745736
0.3 0.57777851165098    0.289383669371939
0.3 0.569134171618255   0.960282005851809
0.3 0.559754516100807   0.852545867109683
0.3 0.55    0.0230401582617037
0.3 0.540245483899194   0.914634890187736
0.3 0.530865828381746   1.07617634333983
0.3 0.52222148834902    0.352508859358053
0.3 0.514644660940673   0.735295320013808
0.3 0.508426519384873   1.22377286644285
0.3 0.503806023374436   0.889714342163864
0.3 0.500960735979838   0.366314237698987
0.3 0.5 0.456449744698853
0.292196387119355   0.6 0.387162907751592
0.292196387119355   0.599039264020162   0.266643638763661
0.292196387119355   0.596193976625564   0.780255221237038
0.292196387119355   0.591573480615127   1.10752374420482
0.292196387119355   0.585355339059327   0.688290910839343
0.292196387119355   0.57777851165098    0.318883165708487
0.292196387119355   0.569134171618255   0.972759816436443
0.292196387119355   0.559754516100807   0.880208128804755
0.292196387119355   0.55    0.235391845616228
0.292196387119355   0.540245483899194   0.934888180700778
0.292196387119355   0.530865828381746   1.09399908305794
0.292196387119355   0.52222148834902    0.353541312924722
0.292196387119355   0.514644660940673   0.713047442652225
0.292196387119355   0.508426519384873   1.20769820870192
0.292196387119355   0.503806023374436   0.918615450377068
0.292196387119355   0.500960735979838   0.321469915339204
0.292196387119355   0.5 0.435304029599358
0.284692662705396   0.6 0.279975804081539
0.284692662705396   0.599039264020162   0.192379520887292
0.284692662705396   0.596193976625564   0.794962744764716
0.284692662705396   0.591573480615127   1.12369112726964
0.284692662705396   0.585355339059327   0.727049571617234
0.284692662705396   0.57777851165098    0.347991771538167
0.284692662705396   0.569134171618255   1.0135449580278
0.284692662705396   0.559754516100807   0.945899457831244
0.284692662705396   0.55    0.39236974698667
0.284692662705396   0.540245483899194   0.964902499460038
0.284692662705396   0.530865828381746   1.11214184801061
0.284692662705396   0.52222148834902    0.395400361114518
0.284692662705396   0.514644660940673   0.741020550306305
0.284692662705396   0.508426519384873   1.233699712921
0.284692662705396   0.503806023374436   0.890373140550437
0.284692662705396   0.500960735979838   0.231499642326115
0.284692662705396   0.5 0.33358329154491
0.277777190679216   0.6 0.266260451249486
0.277777190679216   0.599039264020162   0.250334817723712
0.277777190679216   0.596193976625564   0.852163985800444
0.277777190679216   0.591573480615127   1.21355026724404
0.277777190679216   0.585355339059327   0.802622773583037
0.277777190679216   0.57777851165098    0.444327141762729
0.277777190679216   0.569134171618255   1.05933596631532
0.277777190679216   0.559754516100807   0.991958087375825
0.277777190679216   0.55    0.544301745107056
0.277777190679216   0.540245483899194   1.05765818393722
0.277777190679216   0.530865828381746   1.14604409462396
0.277777190679216   0.52222148834902    0.474927926744428
0.277777190679216   0.514644660940673   0.80864515723635
0.277777190679216   0.508426519384873   1.28116481418815
0.277777190679216   0.503806023374436   0.978993854675887
0.277777190679216   0.500960735979838   0.296776510067091
0.277777190679216   0.5 0.316436638580684
0.271715728752538   0.6 0.294906214735254
0.271715728752538   0.599039264020162   0.342866343308852
0.271715728752538   0.596193976625564   0.950115276922805
0.271715728752538   0.591573480615127   1.26154063598503
0.271715728752538   0.585355339059327   0.880586628104097
0.271715728752538   0.57777851165098    0.494601825543655
0.271715728752538   0.569134171618255   1.06894932718891
0.271715728752538   0.559754516100807   1.03780689249245
0.271715728752538   0.55    0.657184010183024
0.271715728752538   0.540245483899194   1.08463387802518
0.271715728752538   0.530865828381746   1.13621069115402
0.271715728752538   0.52222148834902    0.513988985379121
0.271715728752538   0.514644660940673   0.926766872920333
0.271715728752538   0.508426519384873   1.39197110899292
0.271715728752538   0.503806023374436   1.08041283726334
0.271715728752538   0.500960735979838   0.432323727593516
0.271715728752538   0.5 0.366480845560872
0.266741215507898   0.6 0.272419176059812
0.266741215507898   0.599039264020162   0.411193902161805
0.266741215507898   0.596193976625564   1.00898733778025
0.266741215507898   0.591573480615127   1.33772610285788
0.266741215507898   0.585355339059327   0.947630274551462
0.266741215507898   0.57777851165098    0.480853423549941
0.266741215507898   0.569134171618255   1.03416421180942
0.266741215507898   0.559754516100807   1.02660825965868
0.266741215507898   0.55    0.685178280474455
0.266741215507898   0.540245483899194   1.09753062021676
0.266741215507898   0.530865828381746   1.11704074950019
0.266741215507898   0.52222148834902    0.514658789860591
0.266741215507898   0.514644660940673   0.977670905896815
0.266741215507898   0.508426519384873   1.45084840024315
0.266741215507898   0.503806023374436   1.11075395936466
0.266741215507898   0.500960735979838   0.453763590636515
0.266741215507898   0.5 0.3555138981662
0.263044818699549   0.6 0.183311638618387
0.263044818699549   0.599039264020162   0.412818149021479
0.263044818699549   0.596193976625564   1.0422938460524
0.263044818699549   0.591573480615127   1.36585052270759
0.263044818699549   0.585355339059327   0.972857359988526
0.263044818699549   0.57777851165098    0.559915767061764
0.263044818699549   0.569134171618255   1.04028836024226
0.263044818699549   0.559754516100807   1.0417101999293
0.263044818699549   0.55    0.738353703552868
0.263044818699549   0.540245483899194   1.07000596965968
0.263044818699549   0.530865828381746   1.10064076576036
0.263044818699549   0.52222148834902    0.532176305004607
0.263044818699549   0.514644660940673   1.00285758209668
0.263044818699549   0.508426519384873   1.45612376337215
0.263044818699549   0.503806023374436   1.15627627853189
0.263044818699549   0.500960735979838   0.455906418830321
0.263044818699549   0.5 0.245269467406065
0.260768588783871   0.6 0.131627024777009
0.260768588783871   0.599039264020162   0.426076264663624
0.260768588783871   0.596193976625564   1.06217655100774
0.260768588783871   0.591573480615127   1.40906758982218
0.260768588783871   0.585355339059327   1.00869781427107
0.260768588783871   0.57777851165098    0.534564276016973
0.260768588783871   0.569134171618255   1.06063217379116
0.260768588783871   0.559754516100807   1.06550259047428
0.260768588783871   0.55    0.766839447716822
0.260768588783871   0.540245483899194   1.07831083166154
0.260768588783871   0.530865828381746   1.08254746067985
0.260768588783871   0.52222148834902    0.547029786254482
0.260768588783871   0.514644660940673   1.05258708059937
0.260768588783871   0.508426519384873   1.51317722814361
0.260768588783871   0.503806023374436   1.1653587871367
0.260768588783871   0.500960735979838   0.475380038604818
0.260768588783871   0.5 0.178065616224561
0.26    0.6 0.163571253542048
0.26    0.599039264020162   0.431432938350601
0.26    0.596193976625564   1.09158781544852
0.26    0.591573480615127   1.42672697806823
0.26    0.585355339059327   1.01944931100503
0.26    0.57777851165098    0.559347740398942
0.26    0.569134171618255   1.0554034614013
0.26    0.559754516100807   1.07516143713474
0.26    0.55    0.786902387419037
0.26    0.540245483899194   1.09549941084957
0.26    0.530865828381746   1.09248130515813
0.26    0.52222148834902    0.572883258429415
0.26    0.514644660940673   1.09526014758864
0.26    0.508426519384873   1.51711272848242
0.26    0.503806023374436   1.21948799885914
0.26    0.500960735979838   0.444788441556357
0.26    0.5 0.17119943478184

This is the result that I get using pgfplots

enter image description here

and this is how it should be (plot generated with matlab)

enter image description here

How can I improve the quality of the plot? Thank you in advance

2
  • Which changes are you interested in specifically? The grid lines? Or the axis labels? Or the colors?
    – Marijn
    Jun 18 at 20:19
  • If you compare the two plots you see that they are different, but I am using the same points. In particular, in the regions I have marked it seems to be wrong. Maybe there is a part of the plot that should be hidden and overlaps with the one we should see, but I do not understand why
    – User1305
    Jun 19 at 5:03

1 Answer 1

0

This will be better.

\begin{filecontents}{input-file.txt}
0.34    0.6 0.16784845236609
0.34    0.599039264020162   0.449340944725675
0.34    0.596193976625564   1.10126818451041
0.34    0.591573480615127   1.45934780647924
0.34    0.585355339059327   1.0246427812154
0.34    0.57777851165098    0.571065984297396
0.34    0.569134171618255   1.07623712852824
0.34    0.559754516100807   1.12465629098543
0.34    0.55    0.787500509369331
0.34    0.540245483899194   1.12015409939905
0.34    0.530865828381746   1.13259283140334
0.34    0.52222148834902    0.568492686096429
0.34    0.514644660940673   1.10089553976541
0.34    0.508426519384873   1.5714479856616
0.34    0.503806023374436   1.22657729591635
0.34    0.500960735979838   0.513403122109212
0.34    0.5 0.169436938727958
0.339231411216129   0.6 0.181945862374656
0.339231411216129   0.599039264020162   0.415596394227327
0.339231411216129   0.596193976625564   1.05905994097856
0.339231411216129   0.591573480615127   1.35089764646065
0.339231411216129   0.585355339059327   1.02142540815158
0.339231411216129   0.57777851165098    0.525248744530274
0.339231411216129   0.569134171618255   1.08086679483286
0.339231411216129   0.559754516100807   1.07774810506582
0.339231411216129   0.55    0.775245573056729
0.339231411216129   0.540245483899194   1.10645466417185
0.339231411216129   0.530865828381746   1.12132946945134
0.339231411216129   0.52222148834902    0.572233527727084
0.339231411216129   0.514644660940673   1.08280074332495
0.339231411216129   0.508426519384873   1.55214263040998
0.339231411216129   0.503806023374436   1.20536251342408
0.339231411216129   0.500960735979838   0.498414219839597
0.339231411216129   0.5 0.167746004932493
0.336955181300451   0.6 0.212283753077523
0.336955181300451   0.599039264020162   0.409885790877354
0.336955181300451   0.596193976625564   1.06414855662836
0.336955181300451   0.591573480615127   1.36645840364238
0.336955181300451   0.585355339059327   0.984877000623279
0.336955181300451   0.57777851165098    0.491421587678596
0.336955181300451   0.569134171618255   1.06777824295722
0.336955181300451   0.559754516100807   1.12418525713356
0.336955181300451   0.55    0.784602078301413
0.336955181300451   0.540245483899194   1.09206305863632
0.336955181300451   0.530865828381746   1.12727171271332
0.336955181300451   0.52222148834902    0.541731176102686
0.336955181300451   0.514644660940673   1.03952020298478
0.336955181300451   0.508426519384873   1.51952420499077
0.336955181300451   0.503806023374436   1.17198988017635
0.336955181300451   0.500960735979838   0.442130587671382
0.336955181300451   0.5 0.221774604774455
0.333258784492102   0.6 0.312285861882379
0.333258784492102   0.599039264020162   0.42503343537243
0.333258784492102   0.596193976625564   0.990297876119652
0.333258784492102   0.591573480615127   1.33413426793052
0.333258784492102   0.585355339059327   0.96516568266834
0.333258784492102   0.57777851165098    0.495854140923719
0.333258784492102   0.569134171618255   1.07228658024174
0.333258784492102   0.559754516100807   1.07288962919032
0.333258784492102   0.55    0.724455943668244
0.333258784492102   0.540245483899194   1.07068402091054
0.333258784492102   0.530865828381746   1.11917038784505
0.333258784492102   0.52222148834902    0.54030779515551
0.333258784492102   0.514644660940673   0.997412760947773
0.333258784492102   0.508426519384873   1.45170577137429
0.333258784492102   0.503806023374436   1.12414009899353
0.333258784492102   0.500960735979838   0.424631468557648
0.333258784492102   0.5 0.281566454647853
0.328284271247462   0.6 0.329847433585048
0.328284271247462   0.599039264020162   0.381346622013918
0.328284271247462   0.596193976625564   0.960273175695715
0.328284271247462   0.591573480615127   1.29613617387869
0.328284271247462   0.585355339059327   0.871775672948957
0.328284271247462   0.57777851165098    0.498028320569001
0.328284271247462   0.569134171618255   1.07072459288508
0.328284271247462   0.559754516100807   1.01598563042696
0.328284271247462   0.55    0.691416261644992
0.328284271247462   0.540245483899194   1.07070232866336
0.328284271247462   0.530865828381746   1.13633474309056
0.328284271247462   0.52222148834902    0.550861688867378
0.328284271247462   0.514644660940673   0.924789199432766
0.328284271247462   0.508426519384873   1.40148215743844
0.328284271247462   0.503806023374436   1.05394264113778
0.328284271247462   0.500960735979838   0.40554546445666
0.328284271247462   0.5 0.321686888290928
0.322222809320784   0.6 0.291794738476832
0.322222809320784   0.599039264020162   0.274778892414575
0.322222809320784   0.596193976625564   0.866368467767339
0.322222809320784   0.591573480615127   1.20616050203607
0.322222809320784   0.585355339059327   0.793127053028286
0.322222809320784   0.57777851165098    0.442873368795027
0.322222809320784   0.569134171618255   1.03454064882765
0.322222809320784   0.559754516100807   1.00263797226301
0.322222809320784   0.55    0.536100587119758
0.322222809320784   0.540245483899194   1.02776376341676
0.322222809320784   0.530865828381746   1.12736214019333
0.322222809320784   0.52222148834902    0.479008749684451
0.322222809320784   0.514644660940673   0.850122169064344
0.322222809320784   0.508426519384873   1.31519882849557
0.322222809320784   0.503806023374436   0.984899656772529
0.322222809320784   0.500960735979838   0.31170791251163
0.322222809320784   0.5 0.294043483954587
0.315307337294604   0.6 0.290065509559609
0.315307337294604   0.599039264020162   0.204407946531863
0.315307337294604   0.596193976625564   0.820385699287654
0.315307337294604   0.591573480615127   1.14250364958085
0.315307337294604   0.585355339059327   0.679366993535661
0.315307337294604   0.57777851165098    0.360217997744986
0.315307337294604   0.569134171618255   1.03393466884543
0.315307337294604   0.559754516100807   0.934730955481913
0.315307337294604   0.55    0.416637103599256
0.315307337294604   0.540245483899194   0.980483954201829
0.315307337294604   0.530865828381746   1.11128299512125
0.315307337294604   0.52222148834902    0.40416217557239
0.315307337294604   0.514644660940673   0.779413790511384
0.315307337294604   0.508426519384873   1.23769397491902
0.315307337294604   0.503806023374436   0.926623314326271
0.315307337294604   0.500960735979838   0.236752663272866
0.315307337294604   0.5 0.314215436564376
0.307803612880645   0.6 0.388434626408841
0.307803612880645   0.599039264020162   0.270934070087601
0.307803612880645   0.596193976625564   0.785548352566943
0.307803612880645   0.591573480615127   1.10222484290624
0.307803612880645   0.585355339059327   0.690361306098708
0.307803612880645   0.57777851165098    0.324529589458168
0.307803612880645   0.569134171618255   1.03493080767063
0.307803612880645   0.559754516100807   0.883088216080198
0.307803612880645   0.55    0.19739835908319
0.307803612880645   0.540245483899194   0.915794927340698
0.307803612880645   0.530865828381746   1.09029092632625
0.307803612880645   0.52222148834902    0.385369821046505
0.307803612880645   0.514644660940673   0.721328880566321
0.307803612880645   0.508426519384873   1.24057982361344
0.307803612880645   0.503806023374436   0.884152329618988
0.307803612880645   0.500960735979838   0.302742138918163
0.307803612880645   0.5 0.407438103749515
0.3 0.6 0.422340001400054
0.3 0.599039264020162   0.321241075782776
0.3 0.596193976625564   0.785112926910731
0.3 0.591573480615127   1.09863958699267
0.3 0.585355339059327   0.684696456745736
0.3 0.57777851165098    0.289383669371939
0.3 0.569134171618255   0.960282005851809
0.3 0.559754516100807   0.852545867109683
0.3 0.55    0.0230401582617037
0.3 0.540245483899194   0.914634890187736
0.3 0.530865828381746   1.07617634333983
0.3 0.52222148834902    0.352508859358053
0.3 0.514644660940673   0.735295320013808
0.3 0.508426519384873   1.22377286644285
0.3 0.503806023374436   0.889714342163864
0.3 0.500960735979838   0.366314237698987
0.3 0.5 0.456449744698853
0.292196387119355   0.6 0.387162907751592
0.292196387119355   0.599039264020162   0.266643638763661
0.292196387119355   0.596193976625564   0.780255221237038
0.292196387119355   0.591573480615127   1.10752374420482
0.292196387119355   0.585355339059327   0.688290910839343
0.292196387119355   0.57777851165098    0.318883165708487
0.292196387119355   0.569134171618255   0.972759816436443
0.292196387119355   0.559754516100807   0.880208128804755
0.292196387119355   0.55    0.235391845616228
0.292196387119355   0.540245483899194   0.934888180700778
0.292196387119355   0.530865828381746   1.09399908305794
0.292196387119355   0.52222148834902    0.353541312924722
0.292196387119355   0.514644660940673   0.713047442652225
0.292196387119355   0.508426519384873   1.20769820870192
0.292196387119355   0.503806023374436   0.918615450377068
0.292196387119355   0.500960735979838   0.321469915339204
0.292196387119355   0.5 0.435304029599358
0.284692662705396   0.6 0.279975804081539
0.284692662705396   0.599039264020162   0.192379520887292
0.284692662705396   0.596193976625564   0.794962744764716
0.284692662705396   0.591573480615127   1.12369112726964
0.284692662705396   0.585355339059327   0.727049571617234
0.284692662705396   0.57777851165098    0.347991771538167
0.284692662705396   0.569134171618255   1.0135449580278
0.284692662705396   0.559754516100807   0.945899457831244
0.284692662705396   0.55    0.39236974698667
0.284692662705396   0.540245483899194   0.964902499460038
0.284692662705396   0.530865828381746   1.11214184801061
0.284692662705396   0.52222148834902    0.395400361114518
0.284692662705396   0.514644660940673   0.741020550306305
0.284692662705396   0.508426519384873   1.233699712921
0.284692662705396   0.503806023374436   0.890373140550437
0.284692662705396   0.500960735979838   0.231499642326115
0.284692662705396   0.5 0.33358329154491
0.277777190679216   0.6 0.266260451249486
0.277777190679216   0.599039264020162   0.250334817723712
0.277777190679216   0.596193976625564   0.852163985800444
0.277777190679216   0.591573480615127   1.21355026724404
0.277777190679216   0.585355339059327   0.802622773583037
0.277777190679216   0.57777851165098    0.444327141762729
0.277777190679216   0.569134171618255   1.05933596631532
0.277777190679216   0.559754516100807   0.991958087375825
0.277777190679216   0.55    0.544301745107056
0.277777190679216   0.540245483899194   1.05765818393722
0.277777190679216   0.530865828381746   1.14604409462396
0.277777190679216   0.52222148834902    0.474927926744428
0.277777190679216   0.514644660940673   0.80864515723635
0.277777190679216   0.508426519384873   1.28116481418815
0.277777190679216   0.503806023374436   0.978993854675887
0.277777190679216   0.500960735979838   0.296776510067091
0.277777190679216   0.5 0.316436638580684
0.271715728752538   0.6 0.294906214735254
0.271715728752538   0.599039264020162   0.342866343308852
0.271715728752538   0.596193976625564   0.950115276922805
0.271715728752538   0.591573480615127   1.26154063598503
0.271715728752538   0.585355339059327   0.880586628104097
0.271715728752538   0.57777851165098    0.494601825543655
0.271715728752538   0.569134171618255   1.06894932718891
0.271715728752538   0.559754516100807   1.03780689249245
0.271715728752538   0.55    0.657184010183024
0.271715728752538   0.540245483899194   1.08463387802518
0.271715728752538   0.530865828381746   1.13621069115402
0.271715728752538   0.52222148834902    0.513988985379121
0.271715728752538   0.514644660940673   0.926766872920333
0.271715728752538   0.508426519384873   1.39197110899292
0.271715728752538   0.503806023374436   1.08041283726334
0.271715728752538   0.500960735979838   0.432323727593516
0.271715728752538   0.5 0.366480845560872
0.266741215507898   0.6 0.272419176059812
0.266741215507898   0.599039264020162   0.411193902161805
0.266741215507898   0.596193976625564   1.00898733778025
0.266741215507898   0.591573480615127   1.33772610285788
0.266741215507898   0.585355339059327   0.947630274551462
0.266741215507898   0.57777851165098    0.480853423549941
0.266741215507898   0.569134171618255   1.03416421180942
0.266741215507898   0.559754516100807   1.02660825965868
0.266741215507898   0.55    0.685178280474455
0.266741215507898   0.540245483899194   1.09753062021676
0.266741215507898   0.530865828381746   1.11704074950019
0.266741215507898   0.52222148834902    0.514658789860591
0.266741215507898   0.514644660940673   0.977670905896815
0.266741215507898   0.508426519384873   1.45084840024315
0.266741215507898   0.503806023374436   1.11075395936466
0.266741215507898   0.500960735979838   0.453763590636515
0.266741215507898   0.5 0.3555138981662
0.263044818699549   0.6 0.183311638618387
0.263044818699549   0.599039264020162   0.412818149021479
0.263044818699549   0.596193976625564   1.0422938460524
0.263044818699549   0.591573480615127   1.36585052270759
0.263044818699549   0.585355339059327   0.972857359988526
0.263044818699549   0.57777851165098    0.559915767061764
0.263044818699549   0.569134171618255   1.04028836024226
0.263044818699549   0.559754516100807   1.0417101999293
0.263044818699549   0.55    0.738353703552868
0.263044818699549   0.540245483899194   1.07000596965968
0.263044818699549   0.530865828381746   1.10064076576036
0.263044818699549   0.52222148834902    0.532176305004607
0.263044818699549   0.514644660940673   1.00285758209668
0.263044818699549   0.508426519384873   1.45612376337215
0.263044818699549   0.503806023374436   1.15627627853189
0.263044818699549   0.500960735979838   0.455906418830321
0.263044818699549   0.5 0.245269467406065
0.260768588783871   0.6 0.131627024777009
0.260768588783871   0.599039264020162   0.426076264663624
0.260768588783871   0.596193976625564   1.06217655100774
0.260768588783871   0.591573480615127   1.40906758982218
0.260768588783871   0.585355339059327   1.00869781427107
0.260768588783871   0.57777851165098    0.534564276016973
0.260768588783871   0.569134171618255   1.06063217379116
0.260768588783871   0.559754516100807   1.06550259047428
0.260768588783871   0.55    0.766839447716822
0.260768588783871   0.540245483899194   1.07831083166154
0.260768588783871   0.530865828381746   1.08254746067985
0.260768588783871   0.52222148834902    0.547029786254482
0.260768588783871   0.514644660940673   1.05258708059937
0.260768588783871   0.508426519384873   1.51317722814361
0.260768588783871   0.503806023374436   1.1653587871367
0.260768588783871   0.500960735979838   0.475380038604818
0.260768588783871   0.5 0.178065616224561
0.26    0.6 0.163571253542048
0.26    0.599039264020162   0.431432938350601
0.26    0.596193976625564   1.09158781544852
0.26    0.591573480615127   1.42672697806823
0.26    0.585355339059327   1.01944931100503
0.26    0.57777851165098    0.559347740398942
0.26    0.569134171618255   1.0554034614013
0.26    0.559754516100807   1.07516143713474
0.26    0.55    0.786902387419037
0.26    0.540245483899194   1.09549941084957
0.26    0.530865828381746   1.09248130515813
0.26    0.52222148834902    0.572883258429415
0.26    0.514644660940673   1.09526014758864
0.26    0.508426519384873   1.51711272848242
0.26    0.503806023374436   1.21948799885914
0.26    0.500960735979838   0.444788441556357
0.26    0.5 0.17119943478184
\end{filecontents}
\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}

\begin{document}
\begin{tikzpicture}
   \begin{axis} [
      view={-37.5}{30},
      enlarge x limits,
      grid=both,
      major grid style={dotted},
      minor grid style={dotted},
      minor tick num=2,
      ymin=0.5,
      ymax=0.6,
      zmax=1.5,
   ]
      \addplot3 [
      surf,
      mesh/rows=17,
      mesh/cols=17,
      mesh input=image,
      ] table {input-file.txt}; 
   \end{axis} 
\end{tikzpicture}
\end{document}

enter image description here

2
  • It seems to be better but if you compare your plot with the one in matlab above you see that it looks like they are not referring to the same data... why?
    – User1305
    Jun 23 at 5:28
  • @User1305 I don't know the reason. Maybe matlab have different algorithm to mesh the line plot to surf plot.
    – Tom
    Jun 23 at 5:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.