# Choosing not to plot

**URL:** <https://discourse.julialang.org/t/choosing-not-to-plot/28085>\
**Category:** New to Julia\
**Tags:** plotting\
**Created:** [August 28, 2019, 7:26am UTC](https://discourse.julialang.org/t/choosing-not-to-plot/28085 "2019-08-28T07:26:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![notstpaul](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@notstpaul](https://discourse.julialang.org/u/notstpaul)\
**Post date:** [August 28, 2019, 7:26am UTC](https://discourse.julialang.org/t/choosing-not-to-plot/28085/1 "2019-08-28T07:26:01Z")

</div>

Greetings everyone,

I don’t want to plot my functions every time I run the script and I don’t want Plots to load when I’m not plotting, but I found that I can’t place the

```julia
using Plots

```

statement inside an if/else statement. i.e.

```julia
print("Generate a diagram as a visual check? (Yes=1, No=0): ")
YN=parse(Float64,readline())

if YN != 1
	println("No diagram.")
else
	using Plots
	plotly()

etc.etc.

```

The only workaround I could guess is to do the following:

```julia
print("Generate a diagram as a visual check? (Yes=1, No=0): ")
YN=parse(Float64,readline())

if YN != 1
	println("No diagram.")
	exit(0) # force exit to avoid loading the Plots module
end

using Plots
plotly()

```

I’m not excited about forcing the script to end, although it works for me as it’s the final step in the script.

Is there are proper way to achieve this?

P.

---

<div class="post-metadata">

**Author:** ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)\
**Post date:** [August 28, 2019, 7:31am UTC](https://discourse.julialang.org/t/choosing-not-to-plot/28085/2 "2019-08-28T07:31:29Z")

</div>

You should be able to use `@eval using Plots`.

---

<div class="post-metadata">

**Author:** ![notstpaul](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@notstpaul](https://discourse.julialang.org/u/notstpaul)\
**Post date:** [August 28, 2019, 7:33am UTC](https://discourse.julialang.org/t/choosing-not-to-plot/28085/3 "2019-08-28T07:33:35Z")

</div>

Apologies, I meant to clarify: I actually _can_ Plot, but I can’t reference macros.

---

<div class="post-metadata">

**Author:** ![notstpaul](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@notstpaul](https://discourse.julialang.org/u/notstpaul)\
**Post date:** [August 28, 2019, 7:34am UTC](https://discourse.julialang.org/t/choosing-not-to-plot/28085/4 "2019-08-28T07:34:52Z")

</div>

> [@simeonschaub](#):
>
> You should be able to use `@eval using Plots` .

Thanks. I’ll look that up.

---

<div class="post-metadata">

**Author:** ![notstpaul](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@notstpaul](https://discourse.julialang.org/u/notstpaul)\
**Post date:** [August 28, 2019, 8:28am UTC](https://discourse.julialang.org/t/choosing-not-to-plot/28085/5 "2019-08-28T08:28:54Z")

</div>

FYI for anyone else - by putting the @layout statement inside the @eval the problem was solved.

```julia
...
else
   using Plots
   plotly()
   @eval l = @layout [a{0.5w} grid(2,2)]
   plot( ... layout = l)
end

```

👍
