使用 pgfplots 绘制眼图

使用 pgfplots 绘制眼图

我是一名正在写硕士论文的学生,希望能够使用 pgfplots 在 LaTeX 中绘制眼图。我有一个 csv 文件,其中包含“时间、电压”格式的眼图数据。主要问题是我不知道如何将使用的数据片段的起始时间值移至零以进行绘制。如果这个问题解决了,我可以用一个简单的 for 循环绘制图表。我现在使用的代码如下所示:


\usepackage{pgfplots}       % <-- in preamble
\pgfplotsset{compat=newest} % <-- in preamble

\newenvironment{ploteye}[2]{
    \begin{tikzpicture}
    \begin{axis}[
        xlabel=Time (s), % \hertz requires SIunits
        ylabel= Voltage (V),
        grid=both,
        minor grid style={gray!25},
        major grid style={gray!25},
        width=1\linewidth,
        height=0.5\linewidth,
        xmin = 0.00000001,
        xmax = 0.0000000108,
        ymin = #1,
        ymax = #2,
        no marks]
}
{
    \end{axis}
    \end{tikzpicture}
}


\begin{ploteye}{0.6}{0.75}
    \addplot[red, thick, restrict x to domain=0.00000001:0.0000000108] table [x=t, y=V, col sep=comma] {TESTEYE.csv};
    \addplot[red, thick, restrict x to domain=0.0000000108:0.0000000116] table [x=t, y=V, col sep=comma] {TESTEYE.csv};
\end{ploteye}

我无法包含 csv 文件,但这里有一个可用的部分:

t, V
1e-08,0.6500000722331679
1.002452634375094e-08,0.6499999958233296
1.00625e-08,0.6499999912358824
1.00626953125e-08,0.6500047575887287
1.006282814489668e-08,0.6500121844537493
1.006309380969004e-08,0.6500528875863556
1.006347930480852e-08,0.6502085112216316
1.006374086198343e-08,0.6503937297065666
1.006400241915833e-08,0.6506520760620437
1.006426397633324e-08,0.650985362121427
1.006452553350815e-08,0.6513891057552539
1.006478709068305e-08,0.6518531194287154
1.006502327096671e-08,0.6523119086676303
1.00653802589026e-08,0.6530406605701877
1.0065625e-08,0.6535437338061559
1.006583223139339e-08,0.6539574304240079
1.006603946278677e-08,0.6543623402774402
1.006645392557355e-08,0.6551366428577461
1.006728285114709e-08,0.6565466793843177
1.006857854800003e-08,0.6584237160945655
1.00700921003431e-08,0.6601917985954187
1.007185056385094e-08,0.6617866035734329
1.007388259042024e-08,0.6631586857342271
1.007649946114467e-08,0.6643930539114974
1.007979785681905e-08,0.6653785017324654
1.008344419030418e-08,0.6660028627801139
1.00877010448323e-08,0.6663818165353163
1.00921775348153e-08,0.6665644005687609
1.009773915101379e-08,0.6666529727244381
1.010529485169153e-08,0.6666839421121482
1.011434048924543e-08,0.6666824774542839
1.012606215812048e-08,0.6666736150815411
1.014266598163788e-08,0.6666675399539991
1.016508299081894e-08,0.6666660117876735
1.01875e-08,0.6666663188578821
1.018762960034949e-08,0.6666691439955266
1.018772848761153e-08,0.6666744562869468
1.018792626213563e-08,0.6667060611055985
1.018832181118382e-08,0.6669220744589041
1.018850987993465e-08,0.6671131012270634
1.018868733901928e-08,0.6673566296244772
1.018890431161891e-08,0.6677469542394384
1.018912128421854e-08,0.6682423049028735
1.018933825681816e-08,0.6688403487542123
1.018955522941779e-08,0.6695332418029275
1.018977220201742e-08,0.6703079796832427
1.018998917461705e-08,0.6711470219670443
1.019019975966486e-08,0.6720029839433203
1.019041237983243e-08,0.6728862700488316
1.0190625e-08,0.6737648215647379
1.01907441215075e-08,0.6742466918937616
1.019085470206585e-08,0.6746888283475538
1.019107586318256e-08,0.6755521127859687
1.019151818541598e-08,0.6771934682983884
1.019240282988281e-08,0.6801606268846836
1.019349442070751e-08,0.6833071415502705
1.019469021054045e-08,0.686193453294221
1.019609240345154e-08,0.6889591693907363
1.019768548313013e-08,0.691447259043128
1.019965344884793e-08,0.693779675305413
1.020212104388831e-08,0.6958569143339742
1.020486677829983e-08,0.6973912663730806
1.020792500627005e-08,0.6984641826003524
1.021127941251529e-08,0.699159211943794
1.021507519119812e-08,0.6995911695793631
1.021974073477045e-08,0.6998504964047059
1.022536618356916e-08,0.6999751860414681
1.023202674490596e-08,0.7000161376049646
1.024008467135149e-08,0.7000185185477866
1.025053351379031e-08,0.700009581607285
1.026590420999543e-08,0.7000018603333817
1.028732314802325e-08,0.6999993286721216
1.029991157401163e-08,0.6999995606840415
1.03125e-08,0.699999843855673
1.031258640023299e-08,0.6999985840432952
1.031267280046598e-08,0.6999948067772965
1.031284560093196e-08,0.699967979647703
1.031319120186392e-08,0.6997653593973039
1.031338588735062e-08,0.699537006295142
1.031358057283733e-08,0.6992048114238394
1.031377525832403e-08,0.6987549325223097
1.031396994381074e-08,0.6981797676604087
1.031416462929744e-08,0.6974775645551261
1.031435931478415e-08,0.6966522436084132
1.031455400027085e-08,0.6957131522844335
1.031474868575756e-08,0.6946746621797698
1.031494337124426e-08,0.6935555918150093
1.031510946231107e-08,0.6925530911337157
1.031538178972333e-08,0.6908646518784144
1.0315625e-08,0.689359651329586
1.031569450754104e-08,0.6889345678208892
1.031579874681361e-08,0.6883035351115261
1.031600722535875e-08,0.6870703486156625
1.031642418244903e-08,0.6847194595437999
1.031725809662959e-08,0.680445934330324
1.0318240016407e-08,0.6760701503664516
1.031929932447337e-08,0.6720427032518517
1.032050190829878e-08,0.6682098565658324
1.032186646373158e-08,0.6646501734416389
1.032341944722803e-08,0.6614241630533985
1.032533809923788e-08,0.6583791137459585
1.032759040993972e-08,0.6557945210482424
1.033006177148313e-08,0.6538414219645429
1.033279558306741e-08,0.6524169630240926
1.033585615283528e-08,0.6514192942990241
1.033927756277114e-08,0.650764921777618
1.034308922764164e-08,0.6503687479401004
1.034774516333845e-08,0.6501338855132307
1.035298145228184e-08,0.6500276120591205
1.03595464114872e-08,0.6499879621101737
1.036793023630332e-08,0.64998360258687
1.037828089710437e-08,0.6499910548672885
1.039236515282815e-08,0.6499978208308729
1.04160496985847e-08,0.6500006712244841
1.044900501855603e-08,0.6500004985588889
1.047450250927802e-08,0.6500001208839777
1.05e-08,0.6499999986349044
1.05001953125e-08,0.6500047647675191
1.050032848405193e-08,0.6500122218661574
1.05005948271558e-08,0.6500531516775719
1.050097781947048e-08,0.6502076048967206
1.050124240599491e-08,0.650395011923099
1.050150699251933e-08,0.6506572804433117
1.050177157904376e-08,0.6509961645670926
1.050203616556819e-08,0.6514068707812164
1.050230075209262e-08,0.6518786646967054
1.050253401449755e-08,0.6523333543399065
1.050282950724877e-08,0.6529377570096392
1.0503125e-08,0.6535452409301372
1.05032970361486e-08,0.6538904861850742
1.05034528791152e-08,0.6541981300973537
1.050376456504841e-08,0.6547930313037411
1.050438793691484e-08,0.6559014077113055
1.050563468064769e-08,0.6578267887679247
1.050708395971423e-08,0.6596483928768593
1.050872073790417e-08,0.661268280715016
1.051063575438415e-08,0.6627061863992952
1.051298045768238e-08,0.6639714432244002
1.051609236236426e-08,0.6650763479330226
1.051969231002052e-08,0.6658303755508674
1.05235558292636e-08,0.6662664362589795
1.052806901662538e-08,0.6665147684748246
1.05331043295004e-08,0.6666296154294742
1.053962271011861e-08,0.6666766833846982
1.054866358082256e-08,0.6666845831173326
1.055558179041128e-08,0.6666778974994755
1.05625e-08,0.6666718870463273
1.05626953125e-08,0.6666764977508406
1.05628312575734e-08,0.6666840991603932
1.056310314772021e-08,0.6667267078049727
1.05634664918278e-08,0.6668718982214739
1.056375662434502e-08,0.6670779617286883
1.056404675686223e-08,0.6673743231888313
1.056433688937945e-08,0.6677619701538786
1.056462702189667e-08,0.6682328773452464
1.056491715441389e-08,0.6687708363819429
1.056520728693111e-08,0.6693529078543766
1.0565625e-08,0.6702055963278597
1.056574759813018e-08,0.6704536221741172
1.05659277018632e-08,0.6708116364834549
1.056628790932925e-08,0.671499770726108
1.056700832426134e-08,0.6727676410365271
1.056824326407751e-08,0.6746422350808972
1.056971819713764e-08,0.6764621557889731
1.057143499611756e-08,0.678117633124954
1.057345228798868e-08,0.679573431367468
1.057598953094026e-08,0.6808612548140437
1.05792296159186e-08,0.6819147311140299
1.058290293862199e-08,0.6826039560597068
1.058712327602963e-08,0.6830166317230287
1.059168649373846e-08,0.6832217988099598
1.059737497437887e-08,0.6833204651816197
1.060483674663828e-08,0.6833527780561742
1.061428727061526e-08,0.6833508078629338
1.0625e-08,0.6833412898216118
1.06251953125e-08,0.6833362869006027
1.062532990908652e-08,0.683328540676466
1.062559910225955e-08,0.683286336132834
1.062597182057554e-08,0.6831362174842661
1.062624936113818e-08,0.6829390467388454
1.062652690170081e-08,0.682659383711656
1.062680444226345e-08,0.6822957960108467
1.062708198282609e-08,0.6818545738616184
1.062735952338873e-08,0.6813490276416533
1.062763706395137e-08,0.6807983596551578
1.062788103197569e-08,0.6802947953978417
1.0628125e-08,0.6797916304700777
1.062833288143597e-08,0.679376612977692
1.062854076287194e-08,0.6789704373723936
1.062895652574389e-08,0.6781938218326756
1.062978805148777e-08,0.6767799781700553
1.063103727081605e-08,0.6749656196049811
1.063260332035242e-08,0.6731308736797589
1.063445734730555e-08,0.6714617561673183
1.063661617735587e-08,0.670038490423766
1.063937025245974e-08,0.6687960103973148
1.064271788698746e-08,0.6678568496940168
1.064652171597871e-08,0.6672563341498713
1.065092376812138e-08,0.6669059878349359
1.065580206385434e-08,0.6667369291967196
1.066181236081566e-08,0.6666642928486523
1.066979686850314e-08,0.666645856677911
1.067968470247435e-08,0.6666521950808599
1.06875e-08,0.6666596796898628
1.06876953125e-08,0.6666646537529667
1.068783082051742e-08,0.6666724640267985
1.068810183655225e-08,0.6667152551198322
1.068846818281592e-08,0.6668624186623475
1.068875419878329e-08,0.6670658587733636
1.068904021475066e-08,0.6673569932591519
1.068932623071802e-08,0.6677369709832869
1.068961224668539e-08,0.6681983664677054
1.068989826265276e-08,0.6687259637236834
1.069018427862013e-08,0.6692980940809793
1.0690625e-08,0.6701969853011962
1.069074139182345e-08,0.6704328353215986
1.069092709622456e-08,0.6708024593934067
1.069129850502677e-08,0.6715119475508455
1.06920413226312e-08,0.6728158348609014
1.069329343093371e-08,0.6747058561361483
1.069477274736879e-08,0.6765176707250976
1.069649895972009e-08,0.6781680141777903
1.06985286657248e-08,0.6796177827554638
1.070109569316779e-08,0.6809034861596744
1.070434887613812e-08,0.6819433060350577
1.070803768831198e-08,0.6826216920570914
1.071227916251479e-08,0.6830266340974589
1.071686721442718e-08,0.6832268937088587
1.07226000338065e-08,0.6833225138856931
1.073013178049491e-08,0.6833530974884662
1.07395489317179e-08,0.6833504652157455
1.075e-08,0.6833411016052887
1.075012960034949e-08,0.683338128423328
1.075022914405005e-08,0.6833326452835751
1.075042823145119e-08,0.6833003442011277
1.075082640625346e-08,0.6830802899571783
1.075101218266377e-08,0.6828902261560615
1.07511923808801e-08,0.6826413459025704
1.075140380600204e-08,0.6822597821082438
1.075161523112398e-08,0.6817784720035991
1.075182665624593e-08,0.6811994420652846
1.075203808136787e-08,0.6805297338581593
1.075224950648981e-08,0.6797810833219812
1.075242590129433e-08,0.6791066919404748
1.07527080351756e-08,0.6779680881141738
1.07529165175878e-08,0.6771026976464846
1.0753125e-08,0.6762413441988926
1.075324646787511e-08,0.6757500446186286
1.075335645130421e-08,0.6753103452538942
1.075357641816242e-08,0.6744516834462682
1.075401635187883e-08,0.6728186571973284
1.075484797296098e-08,0.6700171702615975
1.075597502444522e-08,0.6667483954798307
1.07571937037999e-08,0.6638013049792476
1.075860038069942e-08,0.661027954568399
1.076019500782807e-08,0.6585402102447868
1.076207870914757e-08,0.6562988403195839
1.07645498604563e-08,0.6541954310839553
1.076729154798188e-08,0.652644697558202
1.077034260343415e-08,0.6515597256767732
1.077379350884895e-08,0.6508376276265244
1.077753110224607e-08,0.6504112462285748
1.078201743543089e-08,0.6501583821708679
1.078707669493375e-08,0.6500392270132055
1.079344940140827e-08,0.6499911771322432
1.080181965947184e-08,0.6499827708140274
1.081210625726193e-08,0.6499897621171157
1.082573845227939e-08,0.6499970919803482
1.084681100757508e-08,0.6500004486404752
1.088161830069315e-08,0.6500005897844574
1.090955915034658e-08,0.6500001547548466
1.09375e-08,0.6500000024816158
1.09376953125e-08,0.6500047684997255
1.093782839377782e-08,0.6500122174283894
1.093809455633347e-08,0.6500530866009594
1.093847821262779e-08,0.6502078494877607
1.093874199079926e-08,0.6503946713531064
1.093900576897074e-08,0.6506558901195213
1.093926954714222e-08,0.6509932759177451
1.093953332531369e-08,0.6514021197003449
1.093979710348517e-08,0.6518718350196123
1.094003112794669e-08,0.6523275925499579
1.094032806397335e-08,0.6529347343069372
1.0940625e-08,0.6535451181809818
1.094079621230367e-08,0.6538887566433019
1.094095226174711e-08,0.6541968484008386
1.094126436063399e-08,0.6547925831743083
1.094188855840774e-08,0.6559024056667586
1.094313695395525e-08,0.6578299480404948
1.094458601207854e-08,0.6596506785139362
1.09462219152785e-08,0.6612692733750274
1.094813734455808e-08,0.6627071758404512
1.095048264976068e-08,0.663972397779332
1.095359456571388e-08,0.6650769294622221
1.095719489140268e-08,0.6658307534696949
1.09610586862703e-08,0.666266653021531
1.096557225422777e-08,0.6665148777433615
1.097060840603676e-08,0.6666296688586008
1.097712817317254e-08,0.6666767010119783
1.098617108597916e-08,0.6666845811023666
1.099308554298958e-08,0.6666778946455202
1.1e-08,0.6666718864186062
1.10001953125e-08,0.6666669649578979
1.100033125963996e-08,0.6666591502857871
1.100060315391987e-08,0.6666161262641549
1.100096648391324e-08,0.6664704150686103
1.100125663597536e-08,0.666263936788092
1.100154678803749e-08,0.6659671659908516
1.100183694009961e-08,0.6655791151753262
1.100212709216174e-08,0.6651078117577978
1.100241724422386e-08,0.6645694682507132
1.100270739628599e-08,0.663987029478214
1.1003125e-08,0.6631341247707682
1.100324762928787e-08,0.6628859163555223
1.100342770695516e-08,0.6625277808764092
1.100378786228975e-08,0.6618394093850297
1.100450817295892e-08,0.6605710868847996
1.100591079558681e-08,0.6584654467722362
1.100740505842032e-08,0.656669404377718
1.100912306689754e-08,0.6550601554435121
1.101113226327731e-08,0.6536520920797309
1.101360757037356e-08,0.652427079963806
1.101686239463174e-08,0.6513902704089471
1.102056576580394e-08,0.650710686110178
1.102482499976313e-08,0.6503052558694551
1.102933512019529e-08,0.6501086290898725
1.103474685722709e-08,0.6500163608753999
1.104159823939344e-08,0.6499849093948941
1.105096610076029e-08,0.649984045966712
1.105673305038015e-08,0.6499902768614443
1.10625e-08,0.6499952327488842
1.106262960034949e-08,0.6499981460581552
1.106273014305716e-08,0.6500036738611608
1.106293122847251e-08,0.6500366204558741
1.10633333993032e-08,0.6502620874632548
1.106351576223386e-08,0.6504503640194009
1.106370014419008e-08,0.6507071895006649
1.106390347297514e-08,0.6510756757496964
1.10641068017602e-08,0.6515364542059982
1.106431013054526e-08,0.6520878886320285
1.106451345933032e-08,0.6527239904479648
1.106471678811537e-08,0.6534347033741265
1.106490320101892e-08,0.6541405815277573
1.10651570730095e-08,0.6551589844101776
1.106538794363333e-08,0.6561148117614799
1.1065625e-08,0.6570933450086224
1.106573194125442e-08,0.6575268372058518
1.106584660712812e-08,0.6579861892871161
1.106607593887552e-08,0.6588821434824937
1.106653460237031e-08,0.6605823572249395
1.106740036239055e-08,0.6634833005545375
1.106846496735485e-08,0.6665592495910055
1.106962054083482e-08,0.6693691727444536
1.107096818712967e-08,0.6720663366933139
1.10724864908265e-08,0.6744963339024166
1.107433448573729e-08,0.676773799421023
1.1076677904167e-08,0.6788645139779604
1.107938453177593e-08,0.6804932416057671
1.108228458041692e-08,0.6816065949758153
1.108543101797489e-08,0.6823422162649008
1.108892089567022e-08,0.6828110450611103
1.109333462758803e-08,0.6831189056270055
1.109840424244498e-08,0.6832732600853691
1.110501544416297e-08,0.6833409566064704
1.111274121947184e-08,0.6833530837372656
1.111887060973592e-08,0.6833469474368784
1.1125e-08,0.6833403794551861
1.112512960034949e-08,0.6833374206807057
1.112523001124561e-08,0.6833318699765289
1.112543083303787e-08,0.6832989527176433
1.112583247662237e-08,0.6830740970145913
1.112601528478583e-08,0.6828855408864138
1.11261991138008e-08,0.6826297272936939
1.11264034874082e-08,0.6822595100450943
1.11266078610156e-08,0.6817960561685276
1.1126812234623e-08,0.6812410486451531
1.11270166082304e-08,0.680600604371427
1.11272209818378e-08,0.6798849853537541
1.112740601968286e-08,0.6791834018425482
1.112766347160563e-08,0.6781497564976869
1.112789766049437e-08,0.6771799563435885
1.1128125e-08,0.6762414488185154
1.112823646968807e-08,0.6757898911043601
1.112834940608597e-08,0.6753377276272335
1.112857527888177e-08,0.6744554053722803
1.112902702447336e-08,0.6727797070939958
1.11298745018264e-08,0.6699327767482682
1.113099979128688e-08,0.6666820986054105
1.113222149248199e-08,0.6637398875836088
1.113363202200497e-08,0.6609719093168651
1.113523025029573e-08,0.6584916560702713
1.113712279295668e-08,0.6562536589564725
1.113959876280431e-08,0.6541615041127898
1.114234592824861e-08,0.6526204073468932
1.114540401132817e-08,0.6515430440204548
1.11488637630713e-08,0.6508268608984532
1.115260908791317e-08,0.650404942071976
1.115711334554403e-08,0.650154866550091
1.11621903214135e-08,0.6500376253828939
1.116858791273615e-08,0.6499907247775824
1.11770021250897e-08,0.6499828407945905
1.118225106254485e-08,0.6499883907907356
1.11875e-08,0.6499937023184228
1.118758640023299e-08,0.6499950485451901
1.118767280046598e-08,0.6499989114511414
1.118784560093196e-08,0.650025906659343
1.118819120186392e-08,0.6502288499824777
1.118838588712455e-08,0.6504573772094481
1.118858057238518e-08,0.6507897406838209
1.118877525764582e-08,0.651239782793628
1.118896994290645e-08,0.6518151056093701
1.118916462816708e-08,0.6525174615951834
1.118935931342772e-08,0.6533429305168401
1.118955399868835e-08,0.6542821651334451
1.118974868394898e-08,0.6553207940511782
1.118994336920962e-08,0.6564399990033373
1.11901094602931e-08,0.6574426126056556
1.119038178690364e-08,0.6591312260571652
1.1190625e-08,0.6606363978831021
1.119069450674324e-08,0.6610615192229916
1.119079874668978e-08,0.6616926193871223
1.119100722658284e-08,0.6629259375142647
1.119142418636898e-08,0.6652770767936574
1.119225810594125e-08,0.6695510542995188
1.119316273690086e-08,0.6736048276864686
1.119413635440741e-08,0.6773732921744675
1.119525065027107e-08,0.6810380845389763
1.11965028432888e-08,0.6844618031945215
1.119796266324331e-08,0.6876930107436581
1.119986993435433e-08,0.6909503511307945
1.120200392114278e-08,0.6936112473288805
1.120438171723281e-08,0.6956889574463484
1.120692494977578e-08,0.6971869874986816
1.12096743639185e-08,0.6982406836888738
1.121279794462483e-08,0.6989822762585958
1.121645624044381e-08,0.6994805253229127
1.122095105632557e-08,0.6997925127844254
1.122624487842047e-08,0.6999490043788879
1.123226014717076e-08,0.7000066462284827
1.123957682716557e-08,0.7000180766465828
1.124478841358278e-08,0.7000129701919456
1.125e-08,0.7000072897391321
1.125008640023299e-08,0.7000059302293291
1.125017280046598e-08,0.7000020541598359
1.125034560093196e-08,0.6999750331175915
1.125069120186392e-08,0.6997720401375905
1.12508858870898e-08,0.6995434861459884
1.125108057231568e-08,0.6992110967533575
1.125127525754156e-08,0.6987610295512655
1.125146994276744e-08,0.6981856824420449
1.125166462799332e-08,0.6974833029479459
1.12518593132192e-08,0.69665781125687
1.125205399844508e-08,0.6957185545954767
1.125224868367096e-08,0.6946799043049646
1.125244336889684e-08,0.6935606786377533
1.125260945998289e-08,0.6925580476538442
1.125288178647017e-08,0.6908694073675506
1.1253125e-08,0.6893642091789155
1.12531945066206e-08,0.6889390820144158
1.125329874667074e-08,0.6883079714612145
1.125350722677103e-08,0.6870746330751368
1.12539241869716e-08,0.6847234552950378
1.125475810737275e-08,0.6804494082418701
1.125574052551818e-08,0.676071057057046
1.125679938780547e-08,0.6720450283898716
1.125800173799867e-08,0.6682124681498454
1.125936627429392e-08,0.6646523295977297
1.126091932796485e-08,0.6614257181204273
1.126283823756918e-08,0.6583798947817193
1.126509049821363e-08,0.655795100985368
1.126756176157648e-08,0.6538418703235878
1.127029545477687e-08,0.6524172991817945
1.127335587692569e-08,0.651419535804001
1.127677717063527e-08,0.6507650752987417
1.128058866792687e-08,0.6503688406851192
1.128524432283751e-08,0.6501339355685191
1.129048012950597e-08,0.6500276371155812
1.129704423628946e-08,0.6499879712385864
1.130540810134901e-08,0.6499836168595345
1.131573042927827e-08,0.6499910511026044
1.132975877727265e-08,0.6499978082821678
1.135340060757631e-08,0.6500006702224278
1.1375e-08,0.6500004596427038
1.13751953125e-08,0.6500052120531754
1.137532867036541e-08,0.6500126766372959
1.137559538609622e-08,0.6500537135226178
1.137597701306407e-08,0.650207506297357
1.137624327254994e-08,0.6503961101188579
1.137650953203581e-08,0.6506605422470179
1.137677579152168e-08,0.6510025221498345
1.137704205100755e-08,0.6514170782341754
1.137730831049342e-08,0.6518931652750053
1.137754003342583e-08,0.6523456921599887
1.137783251671292e-08,0.6529443561363841
1.1378125e-08,0.6535457756859211
1.137829878035165e-08,0.6538944140213739
1.137845420156455e-08,0.6542011337655437
1.137876504399037e-08,0.6547943141512297
1.137938672884201e-08,0.6558997022262925
1.138063009854529e-08,0.657820606153019
1.138207917287402e-08,0.6596431941739008
1.138371543279125e-08,0.6612637955864548
1.138562975347431e-08,0.6627024148412042
1.138797291547197e-08,0.6639681383410297
1.139108390067378e-08,0.6650740806615156
1.139468267705016e-08,0.6658289396201506
1.139854504435969e-08,0.6662656002996975
1.140305680087456e-08,0.6665143460855389
1.140808937420975e-08,0.6666294168896905
1.141460328013701e-08,0.6666766232606638
1.14236374300047e-08,0.6666845939311657
1.143056871500235e-08,0.6666779098730194
1.14375e-08,0.666671890375569
1.143762960034949e-08,0.6666746043567713
1.143772976861125e-08,0.6666799458828317
1.143793010513478e-08,0.6667123176267833
1.143833077818183e-08,0.6669351121096196
1.143851441078572e-08,0.6671237757576491
1.143869722131964e-08,0.6673773338798343
1.143890353914369e-08,0.6677503427710687
1.143910985696773e-08,0.6682183720963555
1.143931617479178e-08,0.6687796486985292
1.143952249261583e-08,0.6694278105782262
1.143972881043988e-08,0.6701522039728861
1.143991135661152e-08,0.670845685896916
1.144017552425187e-08,0.6719074994411229
1.144041613420925e-08,0.6729038166172767
1.1440625e-08,0.6737658261935419
1.144074624655274e-08,0.6742561133206829
1.144085628400057e-08,0.6746959229346278
1.144107635889623e-08,0.675554787677471
1.144151650868755e-08,0.6771881582497936
1.144235546998082e-08,0.6800120289643155
1.144344911527077e-08,0.6831868050345623
1.144464068625933e-08,0.6860842175551429
1.14460349579391e-08,0.6888573147657691
1.144762086133054e-08,0.6913579301358019
1.144956875783063e-08,0.6936932877252173
1.145202658941736e-08,0.6957914480899031
1.14547621773723e-08,0.6973445119303185
1.145780728799443e-08,0.6984321605882099
1.146115021906227e-08,0.6991391038189569
1.146492300277968e-08,0.6995787075522566
1.146955808129468e-08,0.6998438980776468
1.147513528648551e-08,0.6999723024955284
1.148176296554065e-08,0.7000155271064722
1.148976578579353e-08,0.700018747868603
1.150010165643553e-08,0.7000099333675287
1.151526152375217e-08,0.700002050507781
1.153644305328899e-08,0.6999993535855592
1.156008747124551e-08,0.6999995086575537
1.159021283198702e-08,0.6999998957564819
1.1625e-08,0.7000000113500349
1.16251953125e-08,0.6999952449204899
1.162532820838454e-08,0.6999878123220376
1.162559400015363e-08,0.6999470666637146
1.162597902504456e-08,0.6997916631274896
1.162624114772136e-08,0.6996060367088593
1.162650327039816e-08,0.6993469603528829
1.162676539307496e-08,0.6990126325243623
1.162702751575176e-08,0.6986075924149262
1.162728963842857e-08,0.698142128087444
1.16275252611015e-08,0.6976841242350191
1.162788433266591e-08,0.6969509948375536
1.1628125e-08,0.6964562585300383
1.16283357040596e-08,0.6960358517409544
1.16285464081192e-08,0.6956245206333594
1.162896781623839e-08,0.6948385203336737
1.162981063247677e-08,0.6934093684400622
1.163122175234752e-08,0.6913898867336936
1.163281628834325e-08,0.6895771301285391
1.163476162316625e-08,0.6878935451986726
1.163705030708184e-08,0.6864672326187022
1.164005915080927e-08,0.6852194837707563
1.164348786174481e-08,0.684363392706363
1.164738597706356e-08,0.6838277818962948
1.165192194302527e-08,0.6835222750660163
1.16571640997443e-08,0.6833761176959143
1.166381588714934e-08,0.6833191218695726
1.167254967669728e-08,0.6833113025638593
1.168002483834864e-08,0.6833199471071154
1.16875e-08,0.6833274409932009
1.168762960034949e-08,0.6833247403518834
1.168772963367833e-08,0.6833194209907076
1.168792970033602e-08,0.683287168091962
1.16883298336514e-08,0.6830651657304758
1.16885139266624e-08,0.6828762886322007
1.168869617185014e-08,0.6826238301306511
1.168890358015116e-08,0.6822490908322418
1.168911098845218e-08,0.6817783285179958
1.16893183967532e-08,0.6812133683608407
1.168952580505422e-08,0.6805607130239452
1.168973321335523e-08,0.6798312407518817
1.168991439901252e-08,0.6791420556875988
1.169018236371745e-08,0.6780641305406221
1.16904267192257e-08,0.6770522642033355
1.1690625e-08,0.6762339659582564
1.169075267279486e-08,0.6757182078639762
1.169086132398458e-08,0.6752843632920954
1.169107862636402e-08,0.6744368296831099
1.16915132311229e-08,0.6728239493766238
1.169238244064065e-08,0.6699032018752757
1.169350730678923e-08,0.6666582015646849
1.169473031135395e-08,0.6637172329697577
1.169614127426242e-08,0.660952977050012
1.16977385276327e-08,0.6584783160343289
1.169963179015853e-08,0.6562430936256366
1.170210893416512e-08,0.6541536108092301
1.17048576273956e-08,0.6526146709877568
1.170791766245147e-08,0.6515390321355435
1.171137978242574e-08,0.6508242343857182
1.17151282779918e-08,0.650403285375609
1.171963333702979e-08,0.6501541047894083
1.172471396877178e-08,0.6500373009120822
1.173112040493207e-08,0.6499906249234646
1.173955070777793e-08,0.6499828508899534
1.174991682401338e-08,0.6499899745133035
1.176373531320798e-08,0.649997239925482
1.178531753455355e-08,0.6500004950757895
1.18125e-08,0.6500005245070695
1.18126953125e-08,0.6500052749868057
1.181282842006051e-08,0.6500127158368963
1.181309463518153e-08,0.65005358233049
1.181347809799854e-08,0.6502082270725826
1.181374211136523e-08,0.6503952008762526
1.181400612473193e-08,0.6506567073476135
1.181427013809862e-08,0.6509945119734134
1.181453415146532e-08,0.6514038812108892
1.181479816483201e-08,0.6518741856752901
1.181503196633603e-08,0.652329617404237
1.181532848316801e-08,0.6529359480172362
1.1815625e-08,0.6535454744556827
1.181579645075402e-08,0.6538895696133965
1.181595243994936e-08,0.6541975232567914
1.181626441834003e-08,0.654793000429965
1.181688837512138e-08,0.6559023742102782
1.181813628868408e-08,0.6578292395352277
1.181958565568593e-08,0.6596504583580906
1.182122315447177e-08,0.661270516480235
1.182313851527072e-08,0.6627080707157419
1.182548397700302e-08,0.6639730913529092
1.182859611413117e-08,0.665077413537848
1.183219657583595e-08,0.6658310410267415
1.183606046649673e-08,0.6662668067521659
1.18405741232187e-08,0.6665149456806914
1.184561058760293e-08,0.6666296960330262
1.185213100431545e-08,0.6666767071142707
1.186117518159536e-08,0.6666845781676564
1.187213280995063e-08,0.6666767456737888
1.188679735327449e-08,0.6666692076447838
1.19103081883828e-08,0.6666660380867765
1.19375e-08,0.6666661618577877
1.19376953125e-08,0.6666709429756528
1.193782841972769e-08,0.666678404370009
1.193809463418306e-08,0.6667193106362815
1.193847809944928e-08,0.6668740113606112
1.193874210983685e-08,0.667061018907716
1.193900612022441e-08,0.6673225559518835
1.193927013061198e-08,0.6676603881140506
1.193953414099954e-08,0.6680697821847255
1.193979815138711e-08,0.6685401094040652
1.194003195570891e-08,0.6689955709941754
1.194032847785445e-08,0.6696019431900232
1.1940625e-08,0.6702115103912292
1.194079644772726e-08,0.6705556161785777
1.194095243768486e-08,0.6708635862627834
1.194126441760007e-08,0.671459095131398
1.194188837743048e-08,0.6725685275467681
1.194304520638351e-08,0.6743662733772329
1.194451126077768e-08,0.6762320971606434
1.194619230104019e-08,0.6779103638093885

简而言之,我的问题是,如何绘制 csvfile 的一部分,并在时间值上进行调整?如果有更好的绘制方法,我很想听听。

多谢

西贝

答案1

所以 --- 请注意我上面的评论,下次尝试将您的问题减少到最低限度,以便帮助我们帮助您。

我在以下示例中所做的是:

  1. csv为了示例,创建一个 8 行文件;

  2. 将其添加到使用环境的示例代码中filecontent以获得单个紧凑代码;它将创建(并覆盖,小心!)文件TEST.csv并使用它;

  3. 删除新环境的定义和嵌套,因为它与问题无关;

  4. 现在,如果有人想添加内容或者解决我的问题,只需复制、粘贴和编译即可。

如果你完成了上述操作,你就会得到答案很多早些时候…

解决方案是使用x expr表参数选项,让您对表值应用数学运算。

\begin{filecontents}[overwrite]{TEST.csv}
    t, V
    0, 1
    1, 2
    2, 3
    3, 4
    4, 3
    5, 2
    6, 1
\end{filecontents}
\documentclass[border=10pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{pgfplots}\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}[]
    \begin{axis}[
        xlabel=Time (s), % \hertz requires SIunits
        ylabel= Voltage (V),
        grid=both,
        minor grid style={gray!25},
        major grid style={gray!25},
        width=1\linewidth,
        height=0.5\linewidth,
        no marks]
        \addplot[red, thick, ] table [x=t, y=V, col sep=comma] {TEST.csv};
        \addplot[black, thick, ] 
              table [x expr=\thisrow{t}+1, y=V, col sep=comma] {TEST.csv};
    \end{axis}
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容