# How to achieve the expected graph?

**URL:** <https://discourse.julialang.org/t/how-to-achieve-the-expected-graph/64195>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [July 7, 2021, 6:44am UTC](https://discourse.julialang.org/t/how-to-achieve-the-expected-graph/64195 "2021-07-07T06:44:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [July 7, 2021, 6:44am UTC](https://discourse.julialang.org/t/how-to-achieve-the-expected-graph/64195/1 "2021-07-07T06:44:33Z")

</div>

I try to reproduce the example of the following link: [Example: The Polynomials.jl logo](https://juliamath.github.io/Polynomials.jl/stable/reference/#Polynomials.fit),  
but I don’t get the image shown in the link:  
 ![chebs](https://global.discourse-cdn.com/julialang/original/3X/a/8/a86fb770031e689641469d7572e3187fb67a2207.jpeg)

I only get the following image  
 ![chebs _1](https://global.discourse-cdn.com/julialang/original/3X/4/0/406c56b0286ab3da8c1de4f9205695cef94bdace.jpeg)

```julia
#https://juliamath.github.io/Polynomials.jl/stable/reference/#Polynomials.fit
using Plots, Polynomials
# T1, T2, T3, and T4:
chebs = [
  ChebyshevT([0, 1]),
  ChebyshevT([0, 0, 1]),
  ChebyshevT([0, 0, 0, 1]),
  ChebyshevT([0, 0, 0, 0, 1]),
]
colors = ["#4063D8", "#389826", "#CB3C33", "#9558B2"]
itr = zip(chebs, colors)
(cheb,col), state = iterate(itr)
p = plot(cheb, c=col, lw=5, legend=false, label="")
for (cheb, col) in Base.Iterators.rest(itr, state)
  plot!(cheb, c=col, lw=5)
end

```

How to achieve the expected graph?

---

<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:** [July 7, 2021, 6:48am UTC](https://discourse.julialang.org/t/how-to-achieve-the-expected-graph/64195/2 "2021-07-07T06:48:23Z")

</div>

You’re just not displaying the final plot (the loop returns `nothing`), so you need to add either `p`, `display(p)`, or `current()` at the end to show the plot.
