# Plot doesn't work, doesn't display in the pane in Atom

**URL:** <https://discourse.julialang.org/t/plot-doesnt-work-doesnt-display-in-the-pane-in-atom/50007>\
**Category:** General Usage\
**Tags:** question, package, plotting\
**Created:** [November 11, 2020, 10:36pm UTC](https://discourse.julialang.org/t/plot-doesnt-work-doesnt-display-in-the-pane-in-atom/50007 "2020-11-11T22:36:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dailysight](https://avatars.discourse-cdn.com/v4/letter/d/ecc23a/32.png) [@Dailysight](https://discourse.julialang.org/u/Dailysight)\
**Post date:** [November 11, 2020, 10:36pm UTC](https://discourse.julialang.org/t/plot-doesnt-work-doesnt-display-in-the-pane-in-atom/50007/1 "2020-11-11T22:36:42Z")

</div>

Hey everyone !  
It’s my first topic on this forum and i’m here to ask a little question about the use of plot. I have done the following code to display a landmark in 3D. But when i call the function “affichage\_R”, nothing display. I have made some research, tried some things like gui() after the plot but still nothing. Do u have any ideas?  
Kind Regards,  
Dailysight

```julia
using Plots
l = 1; 

function affichage_R(Tc, l)

x=zeros(3);
y=zeros(3);
z=zeros(3);

P=Tc[1:3,4];
P1=Tc[1:3,4]+Tc[1:3,1]*l;#Pour Sc
P2=Tc[1:3,4]+Tc[1:3,2]*l;#Pour Nc
P3=Tc[1:3,4]+Tc[1:3,3]*l;#Pour Ac

#Affichage Sc
x[1]=P[1];
x[2]=P1[1];
y[1]=P[2];
y[2]=P1[2];
z[1]=P[3];
z[2]=P1[3];

plot3d(x,y,z)
gui()
#Affichage Nc
x[1]=P[1];
x[2]=P2[1];
y[1]=P[2];
y[2]=P2[2];
z[1]=P[3];
z[2]=P2[3];
plot3d!(x,y,z)

#Affichage Ac
x[1]=P[1];
x[2]=P3[1];
y[1]=P[2];
y[2]=P3[2];
z[1]=P[3];
z[2]=P3[3];
plot3d!(x,y,z)

end

affichage_R(T01,l)

```

---

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [November 11, 2020, 11:13pm UTC](https://discourse.julialang.org/t/plot-doesnt-work-doesnt-display-in-the-pane-in-atom/50007/2 "2020-11-11T23:13:23Z")

</div>

Hi! Welcome to Julia’s discourse forum!

The problem in here is that you need to either return the plot object from the function, or to call display() before. This is done automatically when you call plot directly in the REPL (and not inside a function).

example:

```julia
using Plots; gr()

function plotsomething()
    p1 = plot(rand(10))
    1+1 # doing something else
    return p1
end

```

or calling display inside

```julia
using Plots; gr()

function plotsomething()
    p1 = plot(rand(10))
    1+1 # doing something else
    display(p1)
    sleep(10)
end

```

You can read about it [in the documentation, which says](https://docs.juliaplots.org/latest/tutorial/#Plotting-in-Scripts):

> ## [Plotting in Scripts](https://docs.juliaplots.org/latest/tutorial/#Plotting-in-Scripts)
> 
> Now that you’re making useful plots, go ahead and add these plotting commands to a script. Now call the script… and the plot doesn’t show up? This is because Julia in interactive use calls `display` on every variable that is returned by a command without a `;` . Thus in each case above, the interactive usage was automatically calling `display` on the returned plot objects.
> 
> In a script, Julia does not do automatic displays (which is why `;` is not necessary). However, if we would like to display our plots in a script, this means we just need to add the `display` call. For example:
> 
> ```julia
> display(plot(x, y))
> 
> ```
> 
> If we have a plot object `p` , we can do `display(p)` at any time.

---

<div class="post-metadata">

**Author:** ![Dailysight](https://avatars.discourse-cdn.com/v4/letter/d/ecc23a/32.png) [@Dailysight](https://discourse.julialang.org/u/Dailysight)\
**Post date:** [November 12, 2020, 10:38am UTC](https://discourse.julialang.org/t/plot-doesnt-work-doesnt-display-in-the-pane-in-atom/50007/3 "2020-11-12T10:38:40Z")

</div>

Oh i understand ! Seems logic after all !  
Thank you to unlock me 🙂  
Kind Regards
