# How do I obtain contour lines in a sequence.

**URL:** https://discourse.paraview.org/t/how-do-i-obtain-contour-lines-in-a-sequence/8530
**Category:** Web Support
**Created:** [December 1, 2021, 11:31am UTC](https://discourse.paraview.org/t/how-do-i-obtain-contour-lines-in-a-sequence/8530 "2021-12-01T11:31:50Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![ksugahar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ksugahar/32/13153_2.png) [@ksugahar](https://discourse.paraview.org/u/ksugahar)
#### Post date: [December 1, 2021, 11:31am UTC](https://discourse.paraview.org/t/how-do-i-obtain-contour-lines-in-a-sequence/8530/1 "2021-12-01T11:31:50Z")

</div>

I have plotted contour lines on a surface.  
I can see smooth lines on paraview but once I export it to file,  
all the contour lines are not sequential (independent points).  
How can I export as closed lines in a sequence.

---

<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: [December 1, 2021, 4:44pm UTC](https://discourse.paraview.org/t/how-do-i-obtain-contour-lines-in-a-sequence/8530/2 "2021-12-01T16:44:49Z")

</div>

Which format do you export to ?

---

<div class="post-metadata">

### Author: ![ksugahar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ksugahar/32/13153_2.png) [@ksugahar](https://discourse.paraview.org/u/ksugahar)
#### Post date: [December 2, 2021, 1:05am UTC](https://discourse.paraview.org/t/how-do-i-obtain-contour-lines-in-a-sequence/8530/3 "2021-12-02T01:05:37Z")

</div>

Any ASCII format is ok with me.  
I will import the file into Matlab.

---

<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: [December 2, 2021, 8:45am UTC](https://discourse.paraview.org/t/how-do-i-obtain-contour-lines-in-a-sequence/8530/4 "2021-12-02T08:45:54Z")

</div>

Afaik matlab does not support 3D format with topology,

---

<div class="post-metadata">

### Author: ![ksugahar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ksugahar/32/13153_2.png) [@ksugahar](https://discourse.paraview.org/u/ksugahar)
#### Post date: [December 2, 2021, 9:30am UTC](https://discourse.paraview.org/t/how-do-i-obtain-contour-lines-in-a-sequence/8530/5 "2021-12-02T09:30:31Z")

</div>

![figure](https://discourse.paraview.org/uploads/default/original/2X/0/082a2f9a1062acfc8568c4b55831b177999f635b.png)  
Whatever the format is, if the file is written in ASCII, I can import into Matlab.  
The problem is that all the points are not in the sequence and do not construct a loop as the Paraview contour plots. ![00](https://discourse.paraview.org/uploads/default/original/2X/0/082bba3763cfd80af645acf2f5a27fd8fe978b04.png)

---

<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: [December 2, 2021, 9:36am UTC](https://discourse.paraview.org/t/how-do-i-obtain-contour-lines-in-a-sequence/8530/6 "2021-12-02T09:36:05Z")

</div>

Matlab is only drawing lines between points in sequence, no idea if you can draw actual line in matlab.

---

<div class="post-metadata">

### Author: ![ksugahar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ksugahar/32/13153_2.png) [@ksugahar](https://discourse.paraview.org/u/ksugahar)
#### Post date: [December 2, 2021, 9:39am UTC](https://discourse.paraview.org/t/how-do-i-obtain-contour-lines-in-a-sequence/8530/7 "2021-12-02T09:39:46Z")

</div>

Matlab is not important. I am just drawing between two points.  
Any other plot tools is OK. The problem is the sequence of the points of the contour lines that Paraview extracts.

---

<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: [December 2, 2021, 9:47am UTC](https://discourse.paraview.org/t/how-do-i-obtain-contour-lines-in-a-sequence/8530/8 "2021-12-02T09:47:09Z")

</div>

What is your ParaView question here ?

---

<div class="post-metadata">

### Author: ![ksugahar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ksugahar/32/13153_2.png) [@ksugahar](https://discourse.paraview.org/u/ksugahar)
#### Post date: [December 2, 2021, 9:53am UTC](https://discourse.paraview.org/t/how-do-i-obtain-contour-lines-in-a-sequence/8530/9 "2021-12-02T09:53:07Z")

</div>

I have plotted contour lines with Paraview.  
Contour lines seem to be ok. but once I saved the lines with CSV file,  
all the points in the CSV files are not in the sequence. They do not make a closed loop.  
My question is how do I make them as the order that makes a closed loop?

---

<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: [December 2, 2021, 12:33pm UTC](https://discourse.paraview.org/t/how-do-i-obtain-contour-lines-in-a-sequence/8530/10 "2021-12-02T12:33:29Z")

</div>

You need to reorganize your points, maybe doable with a prog filter, but that seems unpractical.

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [December 2, 2021, 2:41pm UTC](https://discourse.paraview.org/t/how-do-i-obtain-contour-lines-in-a-sequence/8530/11 "2021-12-02T14:41:24Z")

</div>

Try using the `Plot On Sorted Lines` filter on the contour lines.

---

<div class="post-metadata">

### Author: ![ksugahar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ksugahar/32/13153_2.png) [@ksugahar](https://discourse.paraview.org/u/ksugahar)
#### Post date: [December 3, 2021, 7:00am UTC](https://discourse.paraview.org/t/how-do-i-obtain-contour-lines-in-a-sequence/8530/12 "2021-12-03T07:00:07Z")

</div>

Thank you. Using the Plot On Sorted Lines worked except for the connection between islands of the contours, I could import to Matlab and obtained the plot attached.  
How could I identify each points belonging to different islands?

 ![mode=01](https://discourse.paraview.org/uploads/default/original/2X/9/9cdd278f7b731ed63e924d29eca570766b1b9525.png)

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [December 3, 2021, 9:14pm UTC](https://discourse.paraview.org/t/how-do-i-obtain-contour-lines-in-a-sequence/8530/13 "2021-12-03T21:14:14Z")

</div>

You can use the `Connectivity` filter to identify each island. A new field named `RegionId` will be added that gives a unique number for each island.

You can then use `Threshold` to extract one island at a time and write out a separate csv file. Or, you can use this field in Matlab to remove lines from one island to the next. Draw lines if the `RegionId` is the same. Don’t draw a line between consecutive points with different `RegionId` values.
