TransWikia.com

Getting an empty plot with Pgflots

TeX - LaTeX Asked by Marco Emerson on December 29, 2020

I have a text file dat.txt with the x,y,z values. I am showing only the first 100 values but there are 200 values in total

804774.399195 328901.289221 86.829826
804774.395437 328901.29186 86.827782
804774.393635 328901.293284 86.827126
804774.391888 328901.294758 86.826447
804774.390181 328901.29627 86.825317
804774.382411 328901.297718 86.822456
804774.3773 328901.305409 86.820862
804774.376464 328901.306996 86.820679
804774.374032 328901.311826 86.819946
804774.366963 328901.321133 86.819954
804774.363053 328901.32554 86.819298
804774.363109 328901.326502 86.820412
804774.363219 328901.326694 86.820465
804774.363377 328901.326822 86.820427
804774.363592 328901.326883 86.820648
804774.368095 328901.322383 86.818855
804774.372919 328901.320097 86.816124
804774.376921 328901.3151 86.815613
804774.379638 328901.31271 86.815208
804774.381038 328901.311598 86.815216
804774.390672 328901.305999 86.815926
804774.396946 328901.301529 86.817055
804774.398879 328901.300933 86.817429
804774.408212 328901.299612 86.819122
804774.409538 328901.299731 86.818863
804774.416766 328901.298638 86.819313
804774.421273 328901.299807 86.820862
804774.423229 328901.300496 86.821884
804774.426868 328901.302066 86.823715
804774.428717 328901.302963 86.824562
804774.4306 328901.303937 86.825546
804774.432554 328901.304994 86.826721
804774.434512 328901.30612 86.826675
804774.439895 328901.309152 86.826721
804774.443575 328901.313266 86.826813
804774.445403 328901.315407 86.826813
804774.447223 328901.317587 86.827003
804774.449091 328901.319796 86.827469
804774.465463 328901.332376 86.831871
804774.483019 328901.346744 86.839256
804774.485944 328901.349118 86.840706
804774.48885 328901.351475 86.842644
804774.514324 328901.365885 86.850998
804774.517101 328901.367619 86.851791
804774.519865 328901.369371 86.852707
804774.531803 328901.37069 86.853569
804774.538393 328901.373319 86.852966
804774.541551 328901.37469 86.852028
804774.547866 328901.377494 86.850105
804774.551025 328901.378884 86.849701
804774.554155 328901.380269 86.849854
804774.55718 328901.381682 86.850487
804774.56015 328901.383104 86.85154
804774.568833 328901.381829 86.852356
804774.57521 328901.384042 86.853844
804774.578342 328901.385181 86.854836
804774.581409 328901.386332 86.85582
804774.584401 328901.387482 86.85659
804774.598907 328901.392956 86.859612
804774.600488 328901.394315 86.860619
804774.605001 328901.398252 86.86351
804774.608293 328901.401179 86.866051
804774.613425 328901.405941 86.869865
804774.614958 328901.40739 86.870796
804774.625552 328901.413359 86.881363
804774.626508 328901.414053 86.883095
804774.627338 328901.414619 86.884933
804774.632315 328901.413883 86.893845
804774.628965 328901.405163 86.906433
804774.627954 328901.403896 86.907639
804774.626881 328901.402683 86.908943
804774.625989 328901.401618 86.910385
804774.621383 328901.395194 86.914787
804774.597211 328901.386924 86.924797
804774.580638 328901.387207 86.931206
804774.5739 328901.387644 86.933319
804774.562269 328901.389091 86.933372
804774.552087 328901.391221 86.931259
804774.545369 328901.392639 86.930038
804774.542092 328901.393314 86.929855
804774.53148 328901.395167 86.930344
804774.52283 328901.396413 86.930656
804774.520121 328901.396696 86.930389
804774.517482 328901.396906 86.930138
804774.514905 328901.397044 86.93
804774.507847 328901.394382 86.928574
804774.506983 328901.39378 86.928276
804774.504798 328901.391806 86.92672
804774.503608 328901.390553 86.925392
804774.502536 328901.389198 86.924431
804774.501732 328901.387748 86.92379
804774.503414 328901.376643 86.922226
804774.503398 328901.374869 86.921906
804774.503529 328901.369936 86.921234
804774.504197 328901.36201 86.919655
804774.511297 328901.344895 86.914513
804774.514696 328901.330148 86.908806
804774.515359 328901.327233 86.907883
804774.521915 328901.312378 86.907654
804774.525123 328901.29574 86.913071

I have been able to do a 3D plot using gnuplot but no matter what I do, I am unable to get a plot with pfgplots or tikz. Sometimes I get a "Dimension too large" error, at other times I get an empty plot. I have tried to restrict either the x or y or z domains but I still get an empty plot. Any ideas on what is wrong?

documentclass[tikz]{standalone}
usepackage{pgfplots}
  
begin{document}  
begin{tikzpicture}
  begin{axis} [yticklabels=empty, xticklabels=empty,zticklabels=empty]
  addplot3+ [only marks,mark size=1, blue] table {dat.txt};
  end{axis}
end{tikzpicture} 
end{document}

One Answer

It seems pgfplots fails to auto set the x-axis limits. Manually setting xmin=804774, xmax=804775 works.

documentclass[tikz, margin=10pt]{standalone}
usepackage{pgfplots}
  
begin{document}  
begin{tikzpicture}
  begin{axis}[yticklabels=empty, xticklabels=empty, zticklabels=empty, xmin=804774, xmax=804775]
    addplot3+ [only marks,mark size=1,blue] table[header=false] {dat.txt};
  end{axis}
end{tikzpicture}
end{document}

enter image description here

Correct answer by muzimuzhi Z on December 29, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP