# Plotting lines from Contours.jl

**URL:** <https://discourse.julialang.org/t/plotting-lines-from-contours-jl/41923>\
**Category:** Visualization\
**Tags:** question\
**Created:** [June 23, 2020, 9:37am UTC](https://discourse.julialang.org/t/plotting-lines-from-contours-jl/41923 "2020-06-23T09:37:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![misha\_mikhasenko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/misha_mikhasenko/32/5060_2.png) [@misha\_mikhasenko](https://discourse.julialang.org/u/misha_mikhasenko)\
**Post date:** [June 23, 2020, 9:37am UTC](https://discourse.julialang.org/t/plotting-lines-from-contours-jl/41923/1 "2020-06-23T09:37:11Z")

</div>

```julia
x = range(-50,50,length=1000)
y = range(0,30,length=1000)
f(x,y) = x/3+log(1000+((x-10)^2+(2y)^2-15^2)^2);
z = f.(transpose(x), y)
contour(x, y, z, levels=0:2.5:40,
    fill=(true, cgrad(:matter, categorical = true)), clim=(0.0,40.0))

```

works beautifully.  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/5/45182a601b4fc61a899c9931654b493127d988c5.png)  
But I need a way to make the same plot with contours given by lines (xs, ys).

The `Contours.jl` package provides these contour lines. So, I can plot them:

```julia
using Contour
cs = contours(x, y, z 2.5:2.5:40);
let 
    plot()
    for (i,c) in enumerate(cs.contours)
        lev = c.level
        for l in c.lines
            x, y = coordinates(l)
            plot!(x, y, lab="", seriescolor=i)
        end
    end
    plot!()
end

```

I just do not find a way to fill the range in between. Any suggestions?
