# plotting line from csv file

**URL:** https://discourse.paraview.org/t/plotting-line-from-csv-file/5469
**Category:** ParaView Support
**Created:** [October 1, 2020, 2:11pm UTC](https://discourse.paraview.org/t/plotting-line-from-csv-file/5469 "2020-10-01T14:11:40Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![MoRaafat](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/958977/32.png) [@MoRaafat](https://discourse.paraview.org/u/MoRaafat)
#### Post date: [October 1, 2020, 2:11pm UTC](https://discourse.paraview.org/t/plotting-line-from-csv-file/5469/1 "2020-10-01T14:11:40Z")

</div>

Hi all,  
i would like to ask about plotting line from csv file. the csv file contains two columns, one for the z-axis and the other for the velocity. i tried to plot the line chart view, but at setting z to be the **x array** error is encountered and nothing is done

 ![1](https://discourse.paraview.org/uploads/default/original/2X/6/6a4821f8dd5db7ac4b2f3c737c44d69849989be1.png) ![2](https://discourse.paraview.org/uploads/default/original/2X/a/a1c5d4577bbe21ac53fc178266c24ae02f44fb2b.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: [October 1, 2020, 2:22pm UTC](https://discourse.paraview.org/t/plotting-line-from-csv-file/5469/2 "2020-10-01T14:22:26Z")

</div>

Can you share your dataset ? This should work out of the box.

---

<div class="post-metadata">

### Author: ![MoRaafat](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/958977/32.png) [@MoRaafat](https://discourse.paraview.org/u/MoRaafat)
#### Post date: [October 1, 2020, 2:26pm UTC](https://discourse.paraview.org/t/plotting-line-from-csv-file/5469/3 "2020-10-01T14:26:24Z")

</div>

[velocity u.csv](https://discourse.paraview.org/uploads/short-url/uNfBdr5bnl1LviS8sWXYoNKt2Ud.csv) (344 Bytes)

---

<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: [October 1, 2020, 2:41pm UTC](https://discourse.paraview.org/t/plotting-line-from-csv-file/5469/4 "2020-10-01T14:41:45Z")

</div>

There is a bug in the delimited text reader for header names without quotes.

Just add quotes to the first line for work around it.  
`"Z","U"`

---

<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: [October 1, 2020, 2:47pm UTC](https://discourse.paraview.org/t/plotting-line-from-csv-file/5469/5 "2020-10-01T14:47:09Z")

</div>

Here is the logged issue : [https://gitlab.kitware.com/vtk/vtk/-/issues/18015](https://gitlab.kitware.com/vtk/vtk/-/issues/18015)

---

<div class="post-metadata">

### Author: ![MoRaafat](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/958977/32.png) [@MoRaafat](https://discourse.paraview.org/u/MoRaafat)
#### Post date: [October 1, 2020, 2:58pm UTC](https://discourse.paraview.org/t/plotting-line-from-csv-file/5469/6 "2020-10-01T14:58:28Z")

</div>

thanks for your quick reply, but when i added the quotes, the velocity column was deleted. [velocity u.csv](https://discourse.paraview.org/uploads/short-url/8BHtIZUAzIUkpC1a54Y8jpEJ6cv.csv) (356 Bytes)

 ![3](https://discourse.paraview.org/uploads/default/original/2X/6/69c82bf64b71c986c3fbaf8dc00a7c2786903b2d.png) ![4](https://discourse.paraview.org/uploads/default/original/2X/c/c5391edfd39f3e6b40db87a0b5876c0d0ef2d635.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: [October 1, 2020, 3:00pm UTC](https://discourse.paraview.org/t/plotting-line-from-csv-file/5469/7 "2020-10-01T15:00:02Z")

</div>

This file works perfectly for me: [velocity u.csv](https://discourse.paraview.org/uploads/short-url/rNVSzf4hjl6Mq8azZaZEMBiThQT.csv) (348 Bytes)

---

<div class="post-metadata">

### Author: ![MoRaafat](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/958977/32.png) [@MoRaafat](https://discourse.paraview.org/u/MoRaafat)
#### Post date: [October 1, 2020, 3:13pm UTC](https://discourse.paraview.org/t/plotting-line-from-csv-file/5469/8 "2020-10-01T15:13:30Z")

</div>

i am so sorry for this disturbance. when i used your last csv file the plot is correctly between z and velocity but the curve is not correct. i used the first file without quotes and used plot matrix view , the proper curve appears. although, i need the curve to compare it with another data

 ![5](https://discourse.paraview.org/uploads/default/original/2X/f/fa23e879c39b0760a5888be8fb26a9297ce2fe1e.png) ![6](https://discourse.paraview.org/uploads/default/original/2X/f/f1f281277674ed087285d6286930012ff767a95d.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: [October 1, 2020, 3:13pm UTC](https://discourse.paraview.org/t/plotting-line-from-csv-file/5469/9 "2020-10-01T15:13:59Z")

</div>

It looks like something (probably MS Excel) added a [byte order mark](https://en.wikipedia.org/wiki/Byte_order_mark) to the file that is confusing ParaView. They are invisible in just about every editor I tried (or used to identify the file as UTF-8), but they showed up when I ran `cat` from a shell.

![2020-10-01_08-42-02](https://discourse.paraview.org/uploads/default/original/2X/1/1761515bfd89ab596cb748e9477cc3a51c260e95.png)

If you have it available on your system, you can use the `dos2unix` program on your system to strip that out, and then the file works. Or, like @mwestphal said, you can put the labels in quotes and ParaView will read it correctly.

This seems like a bug to me, so I filed a bug report: [#20243](https://gitlab.kitware.com/paraview/paraview/-/issues/20243).

---

<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: [October 1, 2020, 3:15pm UTC](https://discourse.paraview.org/t/plotting-line-from-csv-file/5469/10 "2020-10-01T15:15:40Z")

</div>

Try turning on the `Sort By X-Axis` option in the `Line Chart View`.

---

<div class="post-metadata">

### Author: ![MoRaafat](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/958977/32.png) [@MoRaafat](https://discourse.paraview.org/u/MoRaafat)
#### Post date: [October 1, 2020, 3:22pm UTC](https://discourse.paraview.org/t/plotting-line-from-csv-file/5469/11 "2020-10-01T15:22:02Z")

</div>

yes, i get the proper curve by turning on the `Sort By X-Axis` option with the file sent by[velocity u.csv](https://discourse.paraview.org/uploads/short-url/rNVSzf4hjl6Mq8azZaZEMBiThQT.csv) (348 Bytes) [velocity u.csv](https://discourse.paraview.org/uploads/short-url/rNVSzf4hjl6Mq8azZaZEMBiThQT.csv) (348 Bytes) @mwestphal

---

<div class="post-metadata">

### Author: ![MoRaafat](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/958977/32.png) [@MoRaafat](https://discourse.paraview.org/u/MoRaafat)
#### Post date: [October 1, 2020, 3:45pm UTC](https://discourse.paraview.org/t/plotting-line-from-csv-file/5469/12 "2020-10-01T15:45:20Z")

</div>

i also have a problem with plotting a contour of velocity at a section with two axis. i think the problem came from the csv file, too, as you mentioned.[velocity contour.csv](https://discourse.paraview.org/uploads/short-url/qdMOlvuEEkRmm0DyT0WF0zRKI1k.csv) (7.5 KB)

 ![1](https://discourse.paraview.org/uploads/default/original/2X/b/bc8db9835f7319260fec2506a097732e8faab853.png) ![2](https://discourse.paraview.org/uploads/default/original/2X/c/cf652ae2d8215775e13c902818e1b6b641b787a9.png) ![3](https://discourse.paraview.org/uploads/default/original/2X/2/2910ae971d96aaa9de9967e6d6449a4d9d86cfce.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: [October 1, 2020, 7:52pm UTC](https://discourse.paraview.org/t/plotting-line-from-csv-file/5469/13 "2020-10-01T19:52:09Z")

</div>

Yes. Same problem. Same workaround. Run the `dos2unix` Unix utility or edit the file to surround the header labels with quotes.

---

<div class="post-metadata">

### Author: ![MoRaafat](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/958977/32.png) [@MoRaafat](https://discourse.paraview.org/u/MoRaafat)
#### Post date: [October 3, 2020, 10:28am UTC](https://discourse.paraview.org/t/plotting-line-from-csv-file/5469/14 "2020-10-03T10:28:31Z")

</div>

thanks to you, i manged to plot the line. can i get help in plotting a contour of velocity like the 1st photo attached. i used ‘table to points’ then ‘Delaunay2d’, so, what is next.

Thanks in advance.

 ![9](https://discourse.paraview.org/uploads/default/original/2X/0/0c27ad08a8a7170cb56a492384718e73cde7f3a8.png)

 ![8](https://discourse.paraview.org/uploads/default/original/2X/d/d22972b1d75cfa87e5484f2901477bb3aee05b2b.png)  
 ![7](https://discourse.paraview.org/uploads/default/original/2X/f/f5dc253de266b7049a32e07e75c1ce5d27ff7bc7.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: [October 4, 2020, 7:33pm UTC](https://discourse.paraview.org/t/plotting-line-from-csv-file/5469/15 "2020-10-04T19:33:09Z")

</div>

See this topic for the answer: [2D contour from .csv](https://discourse.paraview.org/t/2d-contour-from-csv/2913)
