# How to change the index of the first point for plotting

**URL:** https://discourse.paraview.org/t/how-to-change-the-index-of-the-first-point-for-plotting/16122
**Category:** ParaView Support
**Created:** [February 7, 2025, 12:02am UTC](https://discourse.paraview.org/t/how-to-change-the-index-of-the-first-point-for-plotting/16122 "2025-02-07T00:02:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![s1291](https://discourse.paraview.org/user_avatar/discourse.paraview.org/s1291/32/15950_2.png) [@s1291](https://discourse.paraview.org/u/s1291)
#### Post date: [February 7, 2025, 12:02am UTC](https://discourse.paraview.org/t/how-to-change-the-index-of-the-first-point-for-plotting/16122/1 "2025-02-07T00:02:04Z")

</div>

Hello,

I have the following set of vertex cells as shown in the screenshot below:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/5/5543308bca053ef26b2469d46a0fa4ad02409559.png)

These vertex cells are ordered **counter-clockwise** as indicated (notice the cells with index 0, 1, … 13, … etc).

When I use the “ **Plot Data** ” Filter and checking the option “Use Index for X Axis” (as shown below):

 ![image](https://discourse.paraview.org/uploads/default/original/2X/b/bf3980df51f4f259f3a147589398de4726449ff0.png)

I want to shift the index of the points: So for example: I want the point with index 13 (shown in the first screenshot above) to be the point with index 0, Index 14 to be index 1, and so on. As a result, the plot will be shifted horizontally.

How to achieve that in ParaView?

I appreciate your help.

Thank you

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 7, 2025, 8:48am UTC](https://discourse.paraview.org/t/how-to-change-the-index-of-the-first-point-for-plotting/16122/2 "2025-02-07T08:48:56Z")

</div>

you need to compute this shifted index. I think the simplest way would probably be by using a programmable filter to compute it.

---

<div class="post-metadata">

### Author: ![s1291](https://discourse.paraview.org/user_avatar/discourse.paraview.org/s1291/32/15950_2.png) [@s1291](https://discourse.paraview.org/u/s1291)
#### Post date: [February 7, 2025, 10:02am UTC](https://discourse.paraview.org/t/how-to-change-the-index-of-the-first-point-for-plotting/16122/3 "2025-02-07T10:02:38Z")

</div>

How?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 7, 2025, 10:03am UTC](https://discourse.paraview.org/t/how-to-change-the-index-of-the-first-point-for-plotting/16122/4 "2025-02-07T10:03:42Z")

</div>

[https://docs.paraview.org/en/latest/ReferenceManual/pythonProgrammableFilter.html](https://docs.paraview.org/en/latest/ReferenceManual/pythonProgrammableFilter.html)

---

<div class="post-metadata">

### Author: ![s1291](https://discourse.paraview.org/user_avatar/discourse.paraview.org/s1291/32/15950_2.png) [@s1291](https://discourse.paraview.org/u/s1291)
#### Post date: [February 7, 2025, 10:15am UTC](https://discourse.paraview.org/t/how-to-change-the-index-of-the-first-point-for-plotting/16122/5 "2025-02-07T10:15:41Z")

</div>

I tried with this:

```auto
data = inputs[0]

# Get the number of points in the dataset
numPoints = data.GetNumberOfPoints()

# Create a new vtkPoints container for the rotated order
newPoints = vtk.vtkPoints()
newPoints.SetNumberOfPoints(numPoints)

offset = 13
for i in range(numPoints):
    # Compute the original index for the new index i
    originalIndex = (i + offset) % numPoints
    pt = data.GetPoint(originalIndex)
    newPoints.SetPoint(i, pt)

# Copy the input to the output so that other data (like cell data) is preserved
output.ShallowCopy(data)

# Replace the points in the output with the newly ordered points
output.SetPoints(newPoints)

```

But I get this error:

```auto
Traceback (most recent call last):
  File "<string>", line 22, in <module>
  File "<string>", line 15, in RequestData
  File "C:\Program Files\ParaView 5.13.2\bin\Lib\site-packages\vtkmodules\numpy_interface\dataset_adapter.py", line 128, in __getattr__
    return getattr(self.VTKObject, name)
AttributeError: 'vtkmodules.vtkCommonDataModel.vtkMultiBlockDataSet' object has no attribute 'GetPoint'

```
