# Plot lines not appearing

**URL:** <https://discourse.julialang.org/t/plot-lines-not-appearing/77839>\
**Category:** New to Julia\
**Created:** [March 14, 2022, 1:13am UTC](https://discourse.julialang.org/t/plot-lines-not-appearing/77839 "2022-03-14T01:13:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CentraCep](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/centracep/32/32454_2.png) [@CentraCep](https://discourse.julialang.org/u/CentraCep)\
**Post date:** [March 14, 2022, 1:13am UTC](https://discourse.julialang.org/t/plot-lines-not-appearing/77839/1 "2022-03-14T01:13:33Z")

</div>

My goal is to replicate a plot similar to this one:

 ![erf](https://global.discourse-cdn.com/julialang/original/3X/a/b/ab019c548e4d6528f802a81d7e5cd4e71b2c5121.png)

Although this is a physics problem. I am basically plotting and `erf()` function. Here is how my code is currently set up right now.

```julia
using SpecialFunctions, Plots

T = 10^6 # temperature of solar corona [K]
η = 10^9*T^(-3/2) # m^2 s^-1

x = range(-1e7, 1e7, step=1)
x_scaled = @. x/(2*sqrt(η))
t = [0, 1, 2, 4]
B_z(x, t) = @. erf(x/sqrt(4*η*t))

plot(x_scaled, B_z(x_scaled, 0), linestyle = :dash)
xlabel!("x")
ylabel!("B_z")
xlims!(-1e7, 1e7)

```

However, I am not quite getting the result I am looking for:

 ![blank](https://global.discourse-cdn.com/julialang/original/3X/c/8/c8517898dda8d4786c5e0f0b6f81b23e123fbd1f.png)

What am I missing here?

---

<div class="post-metadata">

**Author:** ![tomerarnon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomerarnon/32/3170_2.png) [@tomerarnon](https://discourse.julialang.org/u/tomerarnon)\
**Post date:** [March 14, 2022, 2:31am UTC](https://discourse.julialang.org/t/plot-lines-not-appearing/77839/2 "2022-03-14T02:31:34Z")

</div>

![discourse_centracep](https://global.discourse-cdn.com/julialang/original/3X/1/4/147fd138bf6a74aa8a6b7a226332cf961c31deb0.png)

I get the above when I run your code.  
Julia v1.6.2, Plots v1.19.3

Not sure why you’re not seeing anything. Does plotting work for other things?

---

<div class="post-metadata">

**Author:** ![CentraCep](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/centracep/32/32454_2.png) [@CentraCep](https://discourse.julialang.org/u/CentraCep)\
**Post date:** [March 14, 2022, 4:54pm UTC](https://discourse.julialang.org/t/plot-lines-not-appearing/77839/3 "2022-03-14T16:54:48Z")

</div>

Yes, I can create simple linear plots, but not what you have produced.

I am using Julia 1.7.0, Plots v1.25 on Jupyter Notebook.

---

<div class="post-metadata">

**Author:** ![CentraCep](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/centracep/32/32454_2.png) [@CentraCep](https://discourse.julialang.org/u/CentraCep)\
**Post date:** [March 14, 2022, 5:25pm UTC](https://discourse.julialang.org/t/plot-lines-not-appearing/77839/4 "2022-03-14T17:25:11Z")

</div>

I am able to get the lines after changing the `x` range to a smaller range.

```julia
x = range(-1e2, 1e2, step=1)

```

For my purposes, this is fine.
