2
$\begingroup$

Why does my ListPlot have a gray line at $x=0$? I have set Ticks and PlotRange options.

enter image description here

traj = ListPlot[data[[All, -1, 1 ;; 2]], 
  Ticks -> {Range[-7, 2, 1], Range[0, 7, 1]}, 
  PlotRange -> {{-6, 2}, {0, 6.4}}, AxesOrigin -> {2, 0}, 
  PlotTheme -> "Scientific"]

The data[[All, -1, 1;;2]] is

{{0, 0}, {-0.0207813, 0.019339}, {-0.0423047, 0.0379762}, {-0.0645281,
   0.0558731}, {-0.0874069, 0.0729935}, {-0.110893, 
  0.0893037}, {-0.134937, 0.104773}, {-0.159486, 
  0.119373}, {-0.184484, 0.133079}, {-0.209874, 0.145869}, {-0.235596,
   0.157725}, {-0.261588, 0.168632}, {-0.287786, 0.17858}, {-0.314125,
   0.187561}, {-0.340538, 0.195572}, {-0.366957, 
  0.202614}, {-0.393312, 0.208694}, {-0.419535, 0.21382}, {-0.445554, 
  0.218009}, {-0.471301, 0.221278}, {-0.496706, 0.223652}, {-0.5217, 
  0.225159}, {-0.546215, 0.225832}, {-0.570185, 0.225709}, {-0.593547,
   0.224831}, {-0.616238, 0.223244}, {-0.6382, 0.221}, {-0.659377, 
  0.218151}, {-0.679716, 0.214756}, {-0.699169, 0.210876}, {-0.717693,
   0.206575}, {-0.735246, 0.201918}, {-0.751796, 
  0.196977}, {-0.767311, 0.19182}, {-0.781768, 0.186521}, {-0.795147, 
  0.181153}, {-0.807435, 0.17579}, {-0.818623, 0.170506}, {-0.82871, 
  0.165375}, {-0.837699, 0.160471}, {-0.845598, 0.155864}, {-0.852423,
   0.151627}, {-0.858194, 0.147827}, {-0.862934, 
  0.144531}, {-0.866675, 0.141804}, {-0.869452, 0.139705}, {-0.871303,
   0.138293}, {-0.872274, 0.137622}, {-0.872411, 
  0.137742}, {-0.871767, 0.1387}, {-0.870396, 0.140538}, {-0.868357, 
  0.143295}, {-0.86571, 0.147003}, {-0.86252, 0.151693}, {-0.85885, 
  0.157389}, {-0.854767, 0.16411}, {-0.850342, 0.171873}, {-0.845641, 
  0.180687}, {-0.840736, 0.19056}, {-0.835697, 0.201491}, {-0.830594, 
  0.21348}, {-0.825497, 0.226516}, {-0.820475, 0.240591}, {-0.815598, 
  0.255686}, {-0.810931, 0.271782}, {-0.80654, 0.288856}, {-0.802491, 
  0.30688}, {-0.798844, 0.325821}, {-0.795661, 0.345647}, {-0.792997, 
  0.366319}, {-0.790908, 0.387797}, {-0.789447, 0.410036}, {-0.788662,
   0.432991}, {-0.788599, 0.456613}, {-0.789302, 0.480852}, {-0.79081,
   0.505656}, {-0.79316, 0.530969}, {-0.796383, 0.556737}, {-0.80051, 
  0.582902}, {-0.805566, 0.609407}, {-0.811572, 0.636192}, {-0.818547,
   0.663198}, {-0.826505, 0.690364}, {-0.835456, 
  0.717632}, {-0.845408, 0.74494}, {-0.856364, 0.772227}, {-0.868322, 
  0.799435}, {-0.881279, 0.826504}, {-0.895226, 0.853375}, {-0.910151,
   0.879991}, {-0.926038, 0.906294}, {-0.942869, 
  0.932229}, {-0.960619, 0.957743}, {-0.979263, 0.982783}, {-0.998771,
   1.0073}, {-1.01911, 1.03124}, {-1.04024, 1.05456}, {-1.06212, 
  1.07721}, {-1.08472, 1.09917}, {-1.10798, 1.12037}, {-1.13185, 
  1.14079}, {-1.15629, 1.1604}, {-1.18123, 1.17917}, {-1.20663, 
  1.19706}, {-1.23241, 1.21406}, {-1.25853, 1.23014}, {-1.28491, 
  1.2453}, {-1.3115, 1.25951}, {-1.33822, 1.27277}, {-1.36501, 
  1.28508}, {-1.3918, 1.29644}, {-1.41852, 1.30685}, {-1.44511, 
  1.31633}, {-1.47148, 1.32487}, {-1.49758, 1.33251}, {-1.52334, 
  1.33927}, {-1.54869, 1.34517}, {-1.57356, 1.35024}, {-1.59789, 
  1.35451}, {-1.62162, 1.35803}, {-1.64469, 1.36084}, {-1.66705, 
  1.36298}, {-1.68864, 1.3645}, {-1.70941, 1.36546}, {-1.72931, 
  1.3659}, {-1.7483, 1.3659}, {-1.76635, 1.3655}, {-1.78342, 
  1.36476}, {-1.79948, 1.36376}}

Any advice will be much appreciated!

$\endgroup$
1
  • 5
    $\begingroup$ The vertical line at x=0 is due to the option GridLines -> {{0}, {0}} which is part of the collection of options injected by PlotTheme -> "Scientific". Try ListPlot[data[[All, -1, 1 ;; 2]], PlotRange -> {{-6, 2}, {0, 6.4}}, GridLines -> None, PlotTheme -> "Scientific", FrameTicks -> {{None, All}, {All, None}}]? $\endgroup$
    – kglr
    Commented Nov 20, 2021 at 0:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.