# @df macro under StatsPlots

**URL:** https://discourse.julialang.org/t/df-macro-under-statsplots/48675
**Category:** General Usage
**Created:** [October 20, 2020, 8:52am UTC](https://discourse.julialang.org/t/df-macro-under-statsplots/48675 "2020-10-20T08:52:28Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Mun\_Barimukh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mun_barimukh/32/17927_2.png) [@Mun\_Barimukh](https://discourse.julialang.org/u/Mun_Barimukh)
#### Post date: [October 20, 2020, 8:52am UTC](https://discourse.julialang.org/t/df-macro-under-statsplots/48675/1 "2020-10-20T08:52:28Z")

</div>

I have used “using StatsPlots;@df df plot(:a, [:b :c], colour = [:red :blue])”. Once I have got the result. But later on it has been showing @df not defined. How to fix it? Please help me out here.

---

<div class="post-metadata">

### Author: ![SteffenPL](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steffenpl/32/206270_2.png) [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)
#### Post date: [October 20, 2020, 9:04am UTC](https://discourse.julialang.org/t/df-macro-under-statsplots/48675/2 "2020-10-20T09:04:53Z")

</div>

Just to understand better what happened:  
You called `using StatsPlots;@df df plot(:a, [:b :c], colour = [:red :blue])` once in your Julia terminal (REPL) and it worked. And another time, where the same code didn’t work?

Could you call `using StatsPlots` (each time you use `@df` the session needs to have loaded `StatsPlots`)? Did you use the same Julia environment?

---

<div class="post-metadata">

### Author: ![Mun\_Barimukh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mun_barimukh/32/17927_2.png) [@Mun\_Barimukh](https://discourse.julialang.org/u/Mun_Barimukh)
#### Post date: [October 20, 2020, 9:14am UTC](https://discourse.julialang.org/t/df-macro-under-statsplots/48675/3 "2020-10-20T09:14:17Z")

</div>

Thanks for your kind response. I called using StatsPlots each time.

---

<div class="post-metadata">

### Author: ![SteffenPL](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steffenpl/32/206270_2.png) [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)
#### Post date: [October 20, 2020, 9:24am UTC](https://discourse.julialang.org/t/df-macro-under-statsplots/48675/4 "2020-10-20T09:24:18Z")

</div>

Can you show the full error message? And, if possible, a minimal example which causes the error?

Should be something like

```julia
using StatsPlots, DataFrames
df = DataFrame(a=1:10,b=rand(10),c=rand(10))
@df df plot(:a, [:b,:c], colour = [:red,:blue])

```

(This code runs fine on my computer, with StatsPlots v0.14.13)

It could also help to get your Julia version and the version of `StatsPlots`. The version of `StatsPlots` can be displayed by entering `]` into the REPL and then `status StatsPlots`.

---

<div class="post-metadata">

### Author: ![Mun\_Barimukh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mun_barimukh/32/17927_2.png) [@Mun\_Barimukh](https://discourse.julialang.org/u/Mun_Barimukh)
#### Post date: [October 20, 2020, 9:30am UTC](https://discourse.julialang.org/t/df-macro-under-statsplots/48675/5 "2020-10-20T09:30:13Z")

</div>

environments\v1.5\Project.toml`  
[f3b207a7] StatsPlots v0.14.13

---

<div class="post-metadata">

### Author: ![Mun\_Barimukh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mun_barimukh/32/17927_2.png) [@Mun\_Barimukh](https://discourse.julialang.org/u/Mun_Barimukh)
#### Post date: [October 20, 2020, 9:34am UTC](https://discourse.julialang.org/t/df-macro-under-statsplots/48675/6 "2020-10-20T09:34:34Z")

</div>

> [@SteffenPL](#):
>
> ```julia
> using StatsPlots, DataFrames
> df = DataFrame(a=1:10,b=rand(10),c=rand(10))
> @df df plot(:a, [:b,:c], colour = [:red,:blue])
> 
> ```

It has worked now. Thank you. If I find such problems, I will come to you. Thank you.
