# How to skip some data points from ListPlot?

**URL:** <https://community.wolfram.com/t/how-to-skip-some-data-points-from-listplot/20273>\
**Category:** Questions\
**Tags:** data-science, graphics-and-visualization\
**Created:** [July 14, 2022, 1:32am UTC](https://community.wolfram.com/t/how-to-skip-some-data-points-from-listplot/20273 "2022-07-14T01:32:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![krishanpme16](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/krishanpme16/32/6369_2.png) [@krishanpme16](https://community.wolfram.com/u/krishanpme16)\
**Post date:** [July 14, 2022, 1:32am UTC](https://community.wolfram.com/t/how-to-skip-some-data-points-from-listplot/20273/1 "2022-07-14T01:32:10Z")

</div>

Hello,

I want to skip some points marked in circled from the plot. Here is my code

```
ClearAll["Global`*"];
\[Sigma] = 5;
Kn = {0.025, 0.1};
Subscript[\[Sigma], v] = 0.85;
Subscript[\[Alpha], v] = (2 - Subscript[\[Sigma], v])/
  Subscript[\[Sigma], v];
\[Alpha] = Subscript[\[Alpha], v] Kn;
u[r_, \[Alpha]_] := (\[Sigma] (BesselI[0, \[Sigma]] - 
     BesselI[0, 
      r \[Sigma]] + \[Alpha] \[Sigma] BesselI[
       1, \[Sigma]]))/(\[Sigma] BesselI[
     0, \[Sigma]] + (-2 + \[Alpha] \[Sigma]^2) BesselI[1, \[Sigma]]);

uth = Plot[
   {u[r, \[Alpha][[1]]], u[r, \[Alpha][[2]]]}, {r, 0, 1},
   PlotStyle -> {{Blue, Thick}, {Red, Thick}},
   PlotLegends -> Placed[{TraditionalForm["\!\(\*
StyleBox[\"Kn\",\nFontSlant->\"Italic\"]\)=0.025"], 
      TraditionalForm["\!\(\*
StyleBox[\"Kn\",\nFontSlant->\"Italic\"]\)=0.1"]}, {Left, Center}],
   LabelStyle -> {FontFamily -> "Times New Roman", 24, Bold}
   ];

unum = With[
   {
    data = 
     Import["C:\\Users\\KRISHAN\\Dropbox\\Journal Drafts\\Draft \
4\\Numerical study\\velocity uniform permeability.xlsx"]
    },
   ListPlot[
    {
     data[[1, All, {1, 2}]], data[[1, All, {1, 3}]]
     },
    PlotStyle -> {{Black, Thick}, {Black, Thick}}
    ]
   ];
Show[
 uth, unum, PlotRange -> {{0, Automatic}, {0, Automatic}},
 AxesOrigin -> {0, 0},
 AxesStyle -> {Black, Black},
 AxesLabel -> {r, "\!\(\*OverscriptBox[\(u\), \(^\)]\)"}
 ]

```

 ![9682Capture.PNG](https://global.discourse-cdn.com/wolfram/original/2X/b/ba59c7ef3c7a4d8d5548605a684e78395a2ded56.png)

One way is to delete the data points from the excel file. But i want the points to be at equally distance or plot to look little decent. It looks a tedious job. I am attaching the excel file too. Please help.

[velocity uniform permeability.xlsx](https://community.wolfram.com/uploads/short-url/t44DlwOkp1hxu5tf08nNog84yQU.xlsx) (15.9 KB)

---

<div class="post-metadata">

**Author:** ![henrikschachner](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikschachner/32/32119_2.png) [@henrikschachner](https://community.wolfram.com/u/henrikschachner)\
**Post date:** [July 14, 2022, 7:33am UTC](https://community.wolfram.com/t/how-to-skip-some-data-points-from-listplot/20273/2 "2022-07-14T07:33:19Z")

</div>

Krishan,

one way is simply to use equally spaced points along an interpolation of your original data:

```
unum = Module[{data, data1, data2, if1, if2, data1i, data2i}, 
   data = Import["C:\\Users\\KRISHAN\\Dropbox\\Journal Drafts\\Draft 4\\Numerical study\\velocity uniform permeability.xlsx"];
   data1 = data[[1, 2 ;;, {1, 2}]];
   data2 = data[[1, 2 ;;, {1, 3}]];
   {if1, if2} = Interpolation /@ {data1, data2}; 
   {data1i, data2i} = Transpose@Table[{{x, if1[x]}, {x, if2[x]}}, {x, 0, 1, .025}]; 
   ListPlot[{data1i, data2i}, PlotStyle -> {{Black, Thick}, {Black, Thick}}]];

```

---

<div class="post-metadata">

**Author:** ![anon21378091](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@anon21378091](https://community.wolfram.com/u/anon21378091)\
**Post date:** [July 14, 2022, 10:47am UTC](https://community.wolfram.com/t/how-to-skip-some-data-points-from-listplot/20273/3 "2022-07-14T10:47:01Z")

</div>

Thanks Henrik Schachner 🙂 It worked.

```
data1 = data[[1, 2 ;;, {1, 2}]];

```

what does exactly this line doing when you are taking part ([[]]) of data (excel file)

---

<div class="post-metadata">

**Author:** ![henrikschachner](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikschachner/32/32119_2.png) [@henrikschachner](https://community.wolfram.com/u/henrikschachner)\
**Post date:** [July 14, 2022, 11:10am UTC](https://community.wolfram.com/t/how-to-skip-some-data-points-from-listplot/20273/4 "2022-07-14T11:10:32Z")

</div>

> what does exactly this line doing …

it skips the first data entry which reads: {“r”, “u kn=0.025”, “u kn=0.1”} and is probably a header (strange that there was no error message). A cleaner solution would have been to import the Excel data like so:

```
data = Import[... , "HeaderLines" -> 1]

```

---

<div class="post-metadata">

**Author:** ![krishanpme16](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/krishanpme16/32/6369_2.png) [@krishanpme16](https://community.wolfram.com/u/krishanpme16)\
**Post date:** [July 14, 2022, 11:38am UTC](https://community.wolfram.com/t/how-to-skip-some-data-points-from-listplot/20273/5 "2022-07-14T11:38:52Z")

</div>

Thanks.
