# Plot problem, flat line in the middle of the plot

**URL:** <https://discourse.julialang.org/t/plot-problem-flat-line-in-the-middle-of-the-plot/120921>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [October 4, 2024, 2:50pm UTC](https://discourse.julialang.org/t/plot-problem-flat-line-in-the-middle-of-the-plot/120921 "2024-10-04T14:50:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ju\_ska](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Post date:** [October 4, 2024, 2:50pm UTC](https://discourse.julialang.org/t/plot-problem-flat-line-in-the-middle-of-the-plot/120921/1 "2024-10-04T14:50:50Z")

</div>

Hi,

I have this datafile:  
[data.jl](https://discourse.julialang.org/uploads/short-url/wAxxftEyB92eUwwllbTkbsVBmqs.jl) (1.7 MB)

I plot doing:

```julia
using CSV
using Plots

csv=CSV.File("data.jl"; header=false, missingstring=["99999.00"])

res=hcat(csv.Column2,csv.Column3,csv.Column4,csv.Column5)
plot(csv.Column1,res, layout = (4, 1), legend=false, size=(1600,600))

```

But I have this strange result:

 ![graph](https://global.discourse-cdn.com/julialang/original/3X/e/c/ec4dbf512720291aaaeb3d8928b600899c6ccdb5.png)

If I plot only:

```julia
plot(res[:,1], legend=false, size=(1600,600))

```

I got:

 ![graph2](https://global.discourse-cdn.com/julialang/original/3X/1/4/14066226ccee9bce546715d7d8297ff539c24fb8.png)

Any help is welcome !

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [October 4, 2024, 2:54pm UTC](https://discourse.julialang.org/t/plot-problem-flat-line-in-the-middle-of-the-plot/120921/2 "2024-10-04T14:54:55Z")

</div>

You’re just missing data?

---

<div class="post-metadata">

**Author:** ![Ju\_ska](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Post date:** [October 4, 2024, 2:57pm UTC](https://discourse.julialang.org/t/plot-problem-flat-line-in-the-middle-of-the-plot/120921/3 "2024-10-04T14:57:04Z")

</div>

Well, no, I edited my post with a graph showing a single column plot.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [October 4, 2024, 3:00pm UTC](https://discourse.julialang.org/t/plot-problem-flat-line-in-the-middle-of-the-plot/120921/4 "2024-10-04T15:00:43Z")

</div>

But the single column plot has no x-values, so of course there can’t be any missing data?

Of course I don’t know what your `column1` etc are, but your plot looks like this:

```julia
julia> plot([1:100; 200:300], rand(201))

```

![image](https://global.discourse-cdn.com/julialang/original/3X/c/6/c6dc0aace0e736e2a8cb8a2b4dc6bd02325763e8.png)

---

<div class="post-metadata">

**Author:** ![Ju\_ska](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Post date:** [October 4, 2024, 3:09pm UTC](https://discourse.julialang.org/t/plot-problem-flat-line-in-the-middle-of-the-plot/120921/5 "2024-10-04T15:09:01Z")

</div>

Mmm I think you nailed it, it’s indeed because of the change of day in the first column:

```julia
20240711235955 33871.41 880.29 17239.29 38019.23
20240712000000 33871.38 880.34 17239.26 38019.14

```

I should take a rest from time to time…

Thanks a lot !

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [October 4, 2024, 3:18pm UTC](https://discourse.julialang.org/t/plot-problem-flat-line-in-the-middle-of-the-plot/120921/6 "2024-10-04T15:18:40Z")

</div>

Happens to the best of us

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [October 4, 2024, 3:51pm UTC](https://discourse.julialang.org/t/plot-problem-flat-line-in-the-middle-of-the-plot/120921/7 "2024-10-04T15:51:38Z")

</div>

In case you haven’t gotten the next step yet, it’s pretty straightforward to read those large integers directly as `DateTimes` by `using Dates` and passing two extra args to `CSV`:

```julia
dateformat=dateformat"yyyymmddHHMMSS", types=Dict(1=>DateTime)

```
