# Gadfly and flatten not defined

**URL:** <https://discourse.julialang.org/t/gadfly-and-flatten-not-defined/32161>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [December 11, 2019, 5:15pm UTC](https://discourse.julialang.org/t/gadfly-and-flatten-not-defined/32161 "2019-12-11T17:15:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alphasig329](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alphasig329/32/9794_2.png) [@alphasig329](https://discourse.julialang.org/u/alphasig329)\
**Post date:** [December 11, 2019, 5:15pm UTC](https://discourse.julialang.org/t/gadfly-and-flatten-not-defined/32161/1 "2019-12-11T17:15:25Z")

</div>

```julia
using JuliaDB, JuliaDBMeta, DataFrames, Gadfly
import Cairo
import Fontconfig
using Compose

group_data = JuliaDB.load("group_data")

test_plot = Gadfly.plot(
        group_data |> DataFrame,
        x = "Group",
        y = "Differences",
        Guide.xlabel("Group"),
        Guide.ylabel("Value"),
        Guide.yticks(ticks = collect(range(-1, 1, step = .2))),
        Scale.x_discrete(levels = groups),
        boxplot_theme,
        Geom.boxplot
    );

```

However after running this script I keep getting the following error: `WARNING: both DataFrames and Iterators export "flatten"; uses of it in module Gadfly must be qualified`. How do I surpress Iterators.flatten for DataFrames.flatten within the Gadfly plot function.

Thanks for any help!

---

<div class="post-metadata">

**Author:** ![GregR](https://avatars.discourse-cdn.com/v4/letter/g/e68b1a/32.png) [@GregR](https://discourse.julialang.org/u/GregR)\
**Post date:** [December 11, 2019, 5:19pm UTC](https://discourse.julialang.org/t/gadfly-and-flatten-not-defined/32161/2 "2019-12-11T17:19:31Z")

</div>

The problem is that the most recent version of DataFrames exports the function “flatten”.  
This conflicts with an identical function name in Gadfly.  
So do this:  
]add DataFrames@0.19

That will downgrade DataFrames to version 0.19.4 which does not export flatten.

---

<div class="post-metadata">

**Author:** ![Mattriks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mattriks/32/351_2.png) [@Mattriks](https://discourse.julialang.org/u/Mattriks)\
**Post date:** [December 11, 2019, 9:13pm UTC](https://discourse.julialang.org/t/gadfly-and-flatten-not-defined/32161/3 "2019-12-11T21:13:34Z")

</div>

PR [https://github.com/GiovineItalia/Gadfly.jl/pull/1360](https://github.com/GiovineItalia/Gadfly.jl/pull/1360) will make Gadfly compatible with DataFrames 0.2

---

<div class="post-metadata">

**Author:** ![alphasig329](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alphasig329/32/9794_2.png) [@alphasig329](https://discourse.julialang.org/u/alphasig329)\
**Post date:** [December 11, 2019, 9:22pm UTC](https://discourse.julialang.org/t/gadfly-and-flatten-not-defined/32161/4 "2019-12-11T21:22:43Z")

</div>

Thank you both. I was able to downgrade DataFrames for it to work. I’ll look at your suggestion Mattriks later night.

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [December 12, 2019, 1:54am UTC](https://discourse.julialang.org/t/gadfly-and-flatten-not-defined/32161/5 "2019-12-12T01:54:35Z")

</div>

the `flatten` for DataFrames and `JuliaDB` should really be in DataAPI.jl. I made an issue [here](https://github.com/JuliaData/DataAPI.jl/issues/14).
