# Julia contour lines issue

**URL:** <https://discourse.julialang.org/t/julia-contour-lines-issue/59333>\
**Category:** Optimization (Mathematical)\
**Tags:** plotting\
**Created:** [April 15, 2021, 11:27am UTC](https://discourse.julialang.org/t/julia-contour-lines-issue/59333 "2021-04-15T11:27:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![safhjkas](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@safhjkas](https://discourse.julialang.org/u/safhjkas)\
**Post date:** [April 15, 2021, 11:27am UTC](https://discourse.julialang.org/t/julia-contour-lines-issue/59333/1 "2021-04-15T11:27:01Z")

</div>

i am trying to sketch a contour lines plot by the code, but it shows “ERROR: UndefVarError: K not defined” can anyone help on how to define the K?

xvec = GradientDescent([1;1])  
plot!(xvec[1,1:1:K], xvec[2,1:1:K], lw = 2, label = “iterates”)  
ERROR: UndefVarError: K not defined  
Stacktrace:  
[1] top-level scope  
@ REPL[6]:1

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [April 15, 2021, 11:33am UTC](https://discourse.julialang.org/t/julia-contour-lines-issue/59333/2 "2021-04-15T11:33:51Z")

</div>

Please read the [guidelines here](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757) and post a MWE.
