# The plot (with Plots pkg) not displayed, if plot(...) is not the last operator

**URL:** <https://discourse.julialang.org/t/the-plot-with-plots-pkg-not-displayed-if-plot-is-not-the-last-operator/34410>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [February 10, 2020, 12:58pm UTC](https://discourse.julialang.org/t/the-plot-with-plots-pkg-not-displayed-if-plot-is-not-the-last-operator/34410 "2020-02-10T12:58:46Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Eben60](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eben60/32/13475_2.png) [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Post date:** [February 10, 2020, 6:37pm UTC](https://discourse.julialang.org/t/the-plot-with-plots-pkg-not-displayed-if-plot-is-not-the-last-operator/34410/3 "2020-02-10T18:37:23Z")

</div>

@nilshg thank you for the explanation and for the suggestions.

Actualy my problem arose as I wanted for plot from a loop (in a function), and now I have found two more discussions on exactly that problem [How to plot in for loop (or map)](https://discourse.julialang.org/t/how-to-plot-in-for-loop-or-map/33881) and [Plotting from within a loop using GR? - #5 by baggepinnen](https://discourse.julialang.org/t/plotting-from-within-a-loop-using-gr/4435/5) .

My prefered solution is to call `current()` or `plot!()` as the last code line.

---

_[View the full topic](https://discourse.julialang.org/t/the-plot-with-plots-pkg-not-displayed-if-plot-is-not-the-last-operator/34410)._
