根据三维点坐标使用matplotlib绘制路径轨迹

需求:有一些点的三维坐标(x,y,z),需要绘制阿基米德螺旋线轨迹图。

points.txt

0.500002, -0.199996, 0.299998
0.500545, -0.199855, 0.299338
0.501112, -0.199688, 0.298704
0.501701, -0.199497, 0.298097
0.502312, -0.199283, 0.29752
0.502942, -0.199045, 0.296973
0.503591, -0.198784, 0.296459
0.504256, -0.198501, 0.295977
0.504936, -0.198196, 0.295531
0.50563, -0.19787, 0.29512
0.506335, -0.197525, 0.294746
0.50705, -0.19716, 0.29441
0.507773, -0.196778, 0.294112
0.508502, -0.196377, 0.293854
0.509236, -0.195961, 0.293636
0.509972, -0.195529, 0.293459
0.510709, -0.195083, 0.293323
0.511445, -0.194624, 0.293229
0.512178, -0.194153, 0.293176
0.512907, -0.193671, 0.293166
0.513628, -0.193179, 0.293198
0.514341, -0.192679, 0.293271
0.515044, -0.192172, 0.293387
0.515735, -0.191659, 0.293544
0.516413, -0.191141, 0.293742
0.517075, -0.19062, 0.293982
0.517719, -0.190097, 0.294261
0.518346, -0.189573, 0.294581
0.518951, -0.18905, 0.294939
0.519535, -0.188529, 0.295335
0.520096, -0.188011, 0.295768
0.520632, -0.187497, 0.296237
0.521142, -0.186989, 0.296741
0.521624, -0.186488, 0.297278
0.522078, -0.185996, 0.297848
0.522502, -0.185513, 0.298449
0.522895, -0.185041, 0.299079
0.523256, -0.184581, 0.299737
0.523585, -0.184133, 0.300421
0.52388, -0.183701, 0.30113
0.52414, -0.183283, 0.301862
0.524365, -0.182882, 0.302614
0.524554, -0.182499, 0.303386
0.524708, -0.182133, 0.304175
0.524824, -0.181788, 0.30498
0.524904, -0.181462, 0.305797
0.524946, -0.181157, 0.306626
0.524952, -0.180875, 0.307464
0.524919, -0.180614, 0.308309
0.52485, -0.180377, 0.30916
0.524743, -0.180164, 0.310012
0.524599, -0.179976, 0.310866
0.524419, -0.179812, 0.311719
0.524202, -0.179673, 0.312567
0.52395, -0.17956, 0.31341
0.523662, -0.179474, 0.314246
0.52334, -0.179413, 0.315071
0.522985, -0.179379, 0.315885
0.522597, -0.179371, 0.316684
0.522176, -0.17939, 0.317468
0.521726, -0.179436, 0.318233
0.521245, -0.179508, 0.318979
0.520736, -0.179606, 0.319703
0.520199, -0.17973, 0.320403
0.519637, -0.17988, 0.321078
0.519049, -0.180056, 0.321725
0.518439, -0.180256, 0.322344
0.517807, -0.180481, 0.322933
0.517155, -0.18073, 0.32349
0.516485, -0.181003, 0.324013
0.515798, -0.181298, 0.324502
0.515095, -0.181615, 0.324955
0.514379, -0.181954, 0.325371
0.513652, -0.182313, 0.325749
0.512915, -0.182691, 0.326088
0.51217, -0.183088, 0.326387
0.511419, -0.183503, 0.326646
0.510664, -0.183934, 0.326863
0.509906, -0.184381, 0.327038
0.509148, -0.184842, 0.32717
0.508391, -0.185316, 0.32726
0.507638, -0.185803, 0.327306
0.50689, -0.186301, 0.32731
0.506149, -0.186808, 0.32727
0.505417, -0.187324, 0.327186
0.504696, -0.187846, 0.32706
0.503988, -0.188375, 0.326891
0.503294, -0.188908, 0.32668
0.502616, -0.189445, 0.326426
0.501956, -0.189983, 0.326132
0.501315, -0.190522, 0.325796
0.500696, -0.191059, 0.325421
0.500099, -0.191595, 0.325007
0.499527, -0.192127, 0.324555
0.49898, -0.192655, 0.324067
0.498461, -0.193176, 0.323542
0.49797, -0.193689, 0.322984
0.497508, -0.194194, 0.322392
0.497078, -0.194689, 0.321769
0.496679, -0.195173, 0.321116
0.496313, -0.195644, 0.320434
0.495981, -0.196101, 0.319726
0.495684, -0.196543, 0.318993
0.495423, -0.19697, 0.318236
0.495198, -0.197379, 0.317459
0.495009, -0.19777, 0.316662
0.494858, -0.198142, 0.315848
0.494745, -0.198495, 0.315018
0.494669, -0.198826, 0.314175
0.494632, -0.199135, 0.313321
0.494634, -0.199422, 0.312458
0.494674, -0.199685, 0.311588
0.494752, -0.199925, 0.310713
0.494868, -0.20014, 0.309836
0.495023, -0.200329, 0.308958
0.495215, -0.200493, 0.308082
0.495444, -0.200631, 0.30721
0.49571, -0.200742, 0.306345
0.496011, -0.200827, 0.305488
0.496348, -0.200885, 0.304641
0.49672, -0.200915, 0.303807
0.497125, -0.200918, 0.302987
0.497562, -0.200894, 0.302185
0.498031, -0.200843, 0.301401
0.49853, -0.200764, 0.300639
0.499059, -0.200658, 0.299899
0.499615, -0.200526, 0.299183
0.500198, -0.200367, 0.298494
0.500806, -0.200182, 0.297833
0.501437, -0.199972, 0.297202
0.50209, -0.199736, 0.296603
0.502764, -0.199476, 0.296036
0.503456, -0.199192, 0.295504
0.504166, -0.198884, 0.295008
0.50489, -0.198554, 0.294548
0.505628, -0.198203, 0.294127
0.506378, -0.19783, 0.293746
0.507137, -0.197438, 0.293404
0.507904, -0.197027, 0.293104
0.508677, -0.196597, 0.292846
0.509454, -0.196151, 0.29263
0.510233, -0.195689, 0.292458
0.511012, -0.195213, 0.292329
0.511789, -0.194723, 0.292245
0.512562, -0.194221, 0.292205
0.51333, -0.193707, 0.292209
0.51409, -0.193184, 0.292258
0.514841, -0.192653, 0.292351
0.51558, -0.192115, 0.292488
0.516305, -0.19157, 0.29267
0.517016, -0.191022, 0.292895
0.51771, -0.19047, 0.293162
0.518384, -0.189917, 0.293472
0.519039, -0.189363, 0.293824
0.519672, -0.18881, 0.294217
0.52028, -0.18826, 0.294649
0.520864, -0.187714, 0.29512
0.521421, -0.187173, 0.295629
0.52195, -0.186639, 0.296174
0.52245, -0.186113, 0.296754
0.522919, -0.185596, 0.297367
0.523356, -0.185089, 0.298013
0.523759, -0.184594, 0.29869
0.524129, -0.184113, 0.299395
0.524464, -0.183645, 0.300127
0.524763, -0.183193, 0.300885
0.525025, -0.182758, 0.301666
0.52525, -0.182341, 0.302468
0.525437, -0.181942, 0.30329
0.525586, -0.181563, 0.30413
0.525696, -0.181205, 0.304985
0.525766, -0.180869, 0.305853
0.525797, -0.180555, 0.306732
0.525789, -0.180264, 0.307621
0.525741, -0.179998, 0.308516
0.525654, -0.179756, 0.309415
0.525528, -0.17954, 0.310317
0.525363, -0.179349, 0.311218
0.525159, -0.179185, 0.312118
0.524917, -0.179048, 0.313012
0.524637, -0.178939, 0.3139
0.524321, -0.178857, 0.314779
0.523969, -0.178802, 0.315647
0.523581, -0.178776, 0.316502
0.523159, -0.178777, 0.31734
0.522704, -0.178807, 0.318162
0.522217, -0.178865, 0.318963
0.521699, -0.17895, 0.319743
0.521151, -0.179064, 0.320499
0.520574, -0.179204, 0.321229
0.519971, -0.179372, 0.321932
0.519342, -0.179567, 0.322606
0.51869, -0.179788, 0.323249
0.518015, -0.180034, 0.323859
0.51732, -0.180306, 0.324435
0.516605, -0.180602, 0.324975
0.515874, -0.180922, 0.325479
0.515127, -0.181264, 0.325944
0.514367, -0.181629, 0.326369
0.513595, -0.182015, 0.326754
0.512814, -0.182422, 0.327098
0.512025, -0.182848, 0.327399
0.51123, -0.183292, 0.327656
0.510432, -0.183753, 0.32787
0.509631, -0.18423, 0.328039
0.508831, -0.184722, 0.328164
0.508034, -0.185227, 0.328242
0.50724, -0.185745, 0.328276
0.506453, -0.186274, 0.328264
0.505674, -0.186813, 0.328206
0.504905, -0.18736, 0.328102
0.504148, -0.187914, 0.327953
0.503405, -0.188474, 0.327759
0.502679, -0.189038, 0.32752
0.501969, -0.189605, 0.327238
0.50128, -0.190173, 0.326912
0.500611, -0.190742, 0.326543
0.499966, -0.191309, 0.326133
0.499345, -0.191873, 0.325682
0.49875, -0.192433, 0.325192
0.498183, -0.192988, 0.324663
0.497645, -0.193535, 0.324097
0.497137, -0.194074, 0.323495
0.496661, -0.194603, 0.322859
0.496218, -0.195121, 0.322191
0.49581, -0.195627, 0.321491
0.495436, -0.196119, 0.320762
0.495098, -0.196596, 0.320005
0.494798, -0.197058, 0.319223
0.494535, -0.197501, 0.318417
0.494311, -0.197927, 0.317589
0.494125, -0.198333, 0.316742
0.49398, -0.198718, 0.315877
0.493874, -0.199082, 0.314997
0.493809, -0.199424, 0.314103
0.493783, -0.199742, 0.313199
0.493799, -0.200036, 0.312285
0.493855, -0.200305, 0.311365
0.493951, -0.200549, 0.310441
0.494088, -0.200767, 0.309515
0.494265, -0.200957, 0.30859
0.494481, -0.201121, 0.307667
0.494736, -0.201257, 0.30675
0.495029, -0.201364, 0.305839
0.495361, -0.201444, 0.304939
0.495729, -0.201495, 0.30405
0.496133, -0.201517, 0.303176
0.496572, -0.20151, 0.302317
0.497045, -0.201475, 0.301478
0.497551, -0.201411, 0.300659
0.498088, -0.201318, 0.299862
0.498656, -0.201197, 0.29909
0.499252, -0.201047, 0.298345
0.499876, -0.20087, 0.297629
0.500526, -0.200666, 0.296943
0.501199, -0.200435, 0.296288
0.501896, -0.200177, 0.295668
0.502613, -0.199894, 0.295083
0.50335, -0.199586, 0.294535
0.504103, -0.199253, 0.294025
0.504872, -0.198897, 0.293554
0.505655, -0.198519, 0.293125
0.506449, -0.198119, 0.292737
0.507252, -0.197698, 0.292392
0.508063, -0.197258, 0.29209
0.50888, -0.196799, 0.291834
0.5097, -0.196323, 0.291622
0.510522, -0.195831, 0.291456
0.511342, -0.195323, 0.291337
0.512161, -0.194802, 0.291264
0.512974, -0.194269, 0.291238
0.513781, -0.193724, 0.291258
0.514579, -0.193169, 0.291326
0.515366, -0.192607, 0.29144
0.51614, -0.192037, 0.291601
0.5169, -0.191461, 0.291808
0.517643, -0.190882, 0.292061
0.518367, -0.1903, 0.292358
0.519071, -0.189716, 0.292701
0.519753, -0.189133, 0.293086
0.520412, -0.188551, 0.293514
0.521044, -0.187973, 0.293984
0.52165, -0.187399, 0.294494
0.522227, -0.186831, 0.295044
0.522774, -0.186271, 0.295631
0.523289, -0.185719, 0.296255
0.523772, -0.185178, 0.296913
0.52422, -0.184648, 0.297605
0.524634, -0.184132, 0.298329
0.525011, -0.183629, 0.299082
0.525351, -0.183142, 0.299863
0.525652, -0.182672, 0.30067
0.525915, -0.18222, 0.301501
0.526139, -0.181787, 0.302354
0.526322, -0.181374, 0.303226
0.526464, -0.180982, 0.304117
0.526566, -0.180613, 0.305023
0.526626, -0.180266, 0.305942
0.526644, -0.179944, 0.306871
0.526621, -0.179646, 0.30781
0.526556, -0.179375, 0.308755
0.52645, -0.179129, 0.309703
0.526303, -0.178911, 0.310653
0.526115, -0.17872, 0.311602
0.525886, -0.178557, 0.312548
0.525618, -0.178422, 0.313489
0.52531, -0.178317, 0.314421
0.524964, -0.17824, 0.315343
0.52458, -0.178193, 0.316252
0.524159, -0.178176, 0.317147
0.523702, -0.178188, 0.318024
0.523211, -0.178229, 0.318882
0.522686, -0.1783, 0.319719
0.52213, -0.1784, 0.320532
0.521542, -0.178529, 0.321319
0.520925, -0.178688, 0.322078
0.520281, -0.178874, 0.322808
0.51961, -0.179088, 0.323506
0.518914, -0.17933, 0.324172
0.518196, -0.179599, 0.324802
0.517457, -0.179894, 0.325396
0.516698, -0.180215, 0.325951
0.515922, -0.18056, 0.326468
0.515131, -0.180929, 0.326943
0.514326, -0.181321, 0.327377
0.51351, -0.181735, 0.327767
0.512684, -0.18217, 0.328113
0.511851, -0.182625, 0.328415
0.511013, -0.183099, 0.32867
0.510171, -0.18359, 0.328879
0.509328, -0.184098, 0.329041
0.508487, -0.184621, 0.329155
0.507648, -0.185158, 0.329222
0.506815, -0.185707, 0.32924
0.505989, -0.186268, 0.329211
0.505172, -0.186838, 0.329133
0.504367, -0.187416, 0.329008
0.503575, -0.188002, 0.328834
0.502799, -0.188593, 0.328614
0.50204, -0.189188, 0.328347
0.501301, -0.189785, 0.328034
0.500582, -0.190384, 0.327675
0.499887, -0.190982, 0.327272
0.499216, -0.191578, 0.326825
0.498572, -0.19217, 0.326336
0.497956, -0.192758, 0.325806
0.497369, -0.193339, 0.325236
0.496814, -0.193912, 0.324627
0.496291, -0.194476, 0.323981
0.495802, -0.195029, 0.3233
0.495348, -0.19557, 0.322585
0.494931, -0.196098, 0.321838
0.49455, -0.19661, 0.32106
0.494208, -0.197107, 0.320254
0.493906, -0.197586, 0.319422
0.493643, -0.198046, 0.318566
0.493421, -0.198487, 0.317688
0.493241, -0.198907, 0.31679
0.493102, -0.199305, 0.315874
0.493005, -0.199679, 0.314943
0.492951, -0.20003, 0.313998
0.492939, -0.200357, 0.313043
0.49297, -0.200657, 0.312079
0.493044, -0.200931, 0.31111
0.49316, -0.201178, 0.310137
0.493318, -0.201397, 0.309163
0.493518, -0.201588, 0.30819
0.49376, -0.20175, 0.307221
0.494042, -0.201883, 0.306258
0.494365, -0.201986, 0.305304
0.494726, -0.202059, 0.30436
0.495127, -0.202102, 0.30343
0.495565, -0.202115, 0.302516
0.496039, -0.202098, 0.30162
0.496548, -0.20205, 0.300744
0.497092, -0.201972, 0.29989
0.497668, -0.201864, 0.299061
0.498276, -0.201727, 0.298259
0.498913, -0.20156, 0.297486
0.499579, -0.201364, 0.296743
0.500271, -0.201139, 0.296032
0.500988, -0.200886, 0.295357
0.501729, -0.200606, 0.294717
0.50249, -0.200299, 0.294115
0.503271, -0.199966, 0.293552
0.504069, -0.199608, 0.29303
0.504883, -0.199225, 0.29255
0.50571, -0.198819, 0.292113
0.506549, -0.198391, 0.29172
0.507397, -0.197942, 0.291373
0.508252, -0.197472, 0.291072
0.509112, -0.196983, 0.290819
0.509975, -0.196476, 0.290613
0.510839, -0.195953, 0.290455
0.511701, -0.195414, 0.290346
0.51256, -0.194862, 0.290286
0.513413, -0.194297, 0.290276
0.514258, -0.19372, 0.290315
0.515093, -0.193134, 0.290403
0.515916, -0.19254, 0.29054
0.516725, -0.191938, 0.290726
0.517518, -0.191332, 0.29096
0.518292, -0.190722, 0.291242
0.519047, -0.190109, 0.291571
0.519779, -0.189495, 0.291946
0.520488, -0.188883, 0.292367
0.521171, -0.188272, 0.292833
0.521826, -0.187666, 0.293341
0.522453, -0.187065, 0.293892
0.523048, -0.18647, 0.294483
0.523612, -0.185885, 0.295114
0.524142, -0.185308, 0.295782
0.524637, -0.184744, 0.296486
0.525096, -0.184192, 0.297225
0.525517, -0.183653, 0.297996
0.5259, -0.183131, 0.298798
0.526244, -0.182625, 0.299629
0.526547, -0.182137, 0.300486
0.526809, -0.181669, 0.301367
0.527029, -0.181221, 0.302271
0.527207, -0.180794, 0.303195
0.527342, -0.180391, 0.304136
0.527433, -0.180011, 0.305093
0.527481, -0.179655, 0.306063
0.527486, -0.179325, 0.307043
0.527447, -0.179022, 0.308032
0.527364, -0.178746, 0.309026
0.527237, -0.178498, 0.310024
0.527068, -0.178278, 0.311022
0.526855, -0.178087, 0.312018
0.526601, -0.177927, 0.31301
0.526304, -0.177796, 0.313996
0.525967, -0.177695, 0.314972
0.525589, -0.177626, 0.315936
0.525172, -0.177587, 0.316887
0.524717, -0.177579, 0.31782
0.524225, -0.177602, 0.318735
0.523697, -0.177656, 0.319629
0.523134, -0.177741, 0.3205
0.522538, -0.177857, 0.321344
0.52191, -0.178003, 0.322161
0.521252, -0.17818, 0.322949
0.520565, -0.178386, 0.323704
0.519851, -0.178621, 0.324426
0.519112, -0.178885, 0.325112
0.51835, -0.179177, 0.325761
0.517566, -0.179496, 0.326371
0.516763, -0.179842, 0.326941
0.515942, -0.180213, 0.327469
0.515106, -0.180609, 0.327953
0.514256, -0.181029, 0.328393
0.513395, -0.181471, 0.328787
0.512525, -0.181935, 0.329135
0.511648, -0.18242, 0.329434
0.510766, -0.182924, 0.329686
0.509882, -0.183446, 0.329888
0.508997, -0.183985, 0.330041
0.508114, -0.18454, 0.330144
0.507235, -0.185108, 0.330197
0.506363, -0.185689, 0.330199
0.505498, -0.186281, 0.330151
0.504645, -0.186883, 0.330052
0.503804, -0.187493, 0.329903
0.502978, -0.18811, 0.329704
0.502169, -0.188733, 0.329455
0.501379, -0.189358, 0.329158
0.50061, -0.189986, 0.328813
0.499864, -0.190615, 0.32842
0.499142, -0.191242, 0.327981
0.498448, -0.191866, 0.327497
0.497781, -0.192487, 0.326968
0.497145, -0.193101, 0.326397
0.49654, -0.193709, 0.325784
0.495969, -0.194307, 0.325132
0.495432, -0.194896, 0.324441
0.494931, -0.195472, 0.323713
0.494468, -0.196035, 0.322951
0.494043, -0.196584, 0.322155
0.493657, -0.197116, 0.321329
0.493313, -0.197631, 0.320473
0.493009, -0.198127, 0.319591
0.492748, -0.198604, 0.318684
0.49253, -0.199059, 0.317755
0.492355, -0.199492, 0.316805
0.492225, -0.199901, 0.315838
0.492139, -0.200286, 0.314856
0.492097, -0.200646, 0.31386
0.4921, -0.200979, 0.312855
0.492148, -0.201285, 0.311841
0.492241, -0.201563, 0.310822
0.492378, -0.201812, 0.3098
0.492559, -0.202032, 0.308778
0.492784, -0.202222, 0.307758
0.493052, -0.202381, 0.306743
0.493363, -0.20251, 0.305735
0.493716, -0.202607, 0.304738
0.494109, -0.202673, 0.303752
0.494543, -0.202708, 0.302782
0.495016, -0.20271, 0.301829
0.495526, -0.202681, 0.300895
0.496073, -0.20262, 0.299984
0.496656, -0.202528, 0.299097
0.497272, -0.202404, 0.298237
0.49792, -0.202248, 0.297405
0.4986, -0.202063, 0.296604
0.499308, -0.201846, 0.295837
0.500043, -0.2016, 0.295104
0.500804, -0.201325, 0.294407
0.501589, -0.201022, 0.293749
0.502395, -0.20069, 0.293132
0.50322, -0.200332, 0.292556
0.504064, -0.199947, 0.292023
0.504922, -0.199537, 0.291535
0.505794, -0.199103, 0.291092
0.506678, -0.198646, 0.290697
0.50757, -0.198167, 0.290349
0.508469, -0.197668, 0.290051
0.509372, -0.197148, 0.289802
0.510278, -0.196611, 0.289603
0.511184, -0.196056, 0.289455
0.512087, -0.195486, 0.289359
0.512986, -0.194902, 0.289314
0.513878, -0.194305, 0.289321
0.514761, -0.193696, 0.289379
0.515633, -0.193079, 0.289489
0.516492, -0.192452, 0.28965
0.517335, -0.19182, 0.289863
0.51816, -0.191182, 0.290126
0.518965, -0.190541, 0.290438
0.519748, -0.189898, 0.2908
0.520508, -0.189255, 0.291211
0.521242, -0.188613, 0.291668
0.521948, -0.187974, 0.292172
0.522626, -0.18734, 0.29272
0.523272, -0.186712, 0.293313
0.523885, -0.186091, 0.293947
0.524464, -0.18548, 0.294622
0.525007, -0.18488, 0.295336
0.525513, -0.184292, 0.296087
0.525981, -0.183718, 0.296874
0.526409, -0.18316, 0.297694
0.526797, -0.182618, 0.298545
0.527142, -0.182094, 0.299425
0.527446, -0.181589, 0.300333
0.527705, -0.181105, 0.301265
0.527921, -0.180643, 0.30222
0.528092, -0.180204, 0.303195
0.528218, -0.179789, 0.304188
0.528298, -0.179399, 0.305196
0.528333, -0.179036, 0.306217
0.528322, -0.1787, 0.307248
0.528265, -0.178391, 0.308287
0.528162, -0.178112, 0.309331
0.528014, -0.177862, 0.310377
0.527821, -0.177642, 0.311423
0.527583, -0.177453, 0.312466
0.527301, -0.177295, 0.313504
0.526975, -0.177169, 0.314534
0.526607, -0.177075, 0.315553
0.526197, -0.177013, 0.316559
0.525746, -0.176983, 0.317549
0.525256, -0.176986, 0.318522
0.524727, -0.177021, 0.319473
0.524161, -0.177089, 0.320402
0.523559, -0.17719, 0.321305
0.522922, -0.177322, 0.322181
0.522253, -0.177486, 0.323027
0.521553, -0.177682, 0.32384
0.520823, -0.177908, 0.32462
0.520066, -0.178165, 0.325364
0.519283, -0.178452, 0.32607
0.518476, -0.178768, 0.326736
0.517648, -0.179112, 0.327361
0.516799, -0.179483, 0.327943
0.515933, -0.179881, 0.328481
0.515052, -0.180305, 0.328973
0.514157, -0.180753, 0.329417
0.513252, -0.181225, 0.329813
0.512337, -0.181719, 0.330161
0.511416, -0.182234, 0.330457
0.510491, -0.182768, 0.330703
0.509564, -0.183322, 0.330898
0.508638, -0.183892, 0.33104
0.507714, -0.184478, 0.33113
0.506795, -0.185078, 0.331167
0.505884, -0.185691, 0.331151
0.504982, -0.186315, 0.331082
0.504092, -0.186949, 0.33096
0.503216, -0.187591, 0.330786
0.502357, -0.188239, 0.33056
0.501516, -0.188893, 0.330282
0.500695, -0.189549, 0.329953
0.499898, -0.190207, 0.329575
0.499125, -0.190865, 0.329146
0.498378, -0.191521, 0.32867
0.497661, -0.192174, 0.328147
0.496973, -0.192822, 0.327578
0.496318, -0.193464, 0.326964
0.495696, -0.194097, 0.326308
0.49511, -0.19472, 0.32561
0.494561, -0.195332, 0.324873
0.494049, -0.195931, 0.324098
0.493578, -0.196516, 0.323288
0.493147, -0.197085, 0.322443
0.492757, -0.197637, 0.321567
0.492411, -0.198169, 0.320661
0.492109, -0.198682, 0.319728
0.491851, -0.199173, 0.31877
0.491638, -0.199642, 0.317789
0.491471, -0.200087, 0.316788
0.49135, -0.200507, 0.31577
0.491276, -0.200901, 0.314736
0.491248, -0.201269, 0.313689
0.491267, -0.201608, 0.312633
0.491334, -0.201918, 0.311569
0.491447, -0.202199, 0.310501
0.491606, -0.20245, 0.309431
0.491812, -0.202669, 0.308361
0.492063, -0.202857, 0.307294
0.492359, -0.203013, 0.306234
0.4927, -0.203137, 0.305182
0.493084, -0.203227, 0.304142
0.49351, -0.203285, 0.303115
0.493979, -0.20331, 0.302105
0.494487, -0.203301, 0.301114
0.495035, -0.203259, 0.300144
0.495621, -0.203184, 0.299199
0.496243, -0.203076, 0.298279
0.496899, -0.202935, 0.297389
0.497116, -0.202883, 0.297111

使用matplotlib库进行绘制

import numpy as np  
import matplotlib.pyplot as plt

# 读取txt文件内容
with open('points.txt', 'r') as file:
    lines = file.readlines()

# 处理数据
x = []
y = []
z = []
for line in lines:
    data = line.strip().split(', ')
    x.append(float(data[0]))
    y.append(float(data[1]))
    z.append(float(data[2]))

# 转换为NumPy数组
x = np.array(x)
y = np.array(y)
z = np.array(z)

print("x =", x)
print("y =", y)
print("z =", z)

ax = plt.subplot(projection='3d')  # 创建一个三维的绘图工程
ax.set_title('3d_image_show')  # 设置本图名称
ax.scatter(x, y, z, c='r',s=5)  # 绘制数据点 c: 'r'红色,'y'黄色等颜色, s代表点的像素大小

ax.set_xlabel('X')  # 设置x坐标轴
ax.set_ylabel('Y')  # 设置y坐标轴
ax.set_zlabel('Z')  # 设置z坐标轴

plt.show()

根据三维点坐标使用matplotlib绘制路径轨迹_第1张图片

你可能感兴趣的:(Python,matplotlib)