# Gadfly DataFrame "cannot convert"

**URL:** <https://discourse.julialang.org/t/gadfly-dataframe-cannot-convert/42383>\
**Category:** New to Julia\
**Created:** [July 1, 2020, 4:39pm UTC](https://discourse.julialang.org/t/gadfly-dataframe-cannot-convert/42383 "2020-07-01T16:39:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![colinclout12](https://avatars.discourse-cdn.com/v4/letter/c/dfb087/32.png) [@colinclout12](https://discourse.julialang.org/u/colinclout12)\
**Post date:** [July 1, 2020, 4:39pm UTC](https://discourse.julialang.org/t/gadfly-dataframe-cannot-convert/42383/1 "2020-07-01T16:39:41Z")

</div>

I’m sure I’m making a relatively elementary error, but when I attempt to work through the Gadfly [tutorial](http://gadflyjl.org/stable/tutorial/#DataFrames-1), I keep getting errors when I run their code. For instance, when I run:

```julia
using RDatasets
using Gadfly
iris = dataset("datasets", "iris")
p = plot(iris, x=:SepalLength, y=:SepalWidth, Geom.point);

```

I get the error:

```julia
ERROR: Cannot convert DataFrame to series data for plotting
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] _prepare_series_data(::DataFrame) at C:\Users\...\.juliapro\JuliaPro_v1.4.2-1\packages\RecipesPipeline\dZsrD\src\series.jl:8
 [3] _series_data_vector(::DataFrame, ::Dict{Symbol,Any}) at C:\Users\...\.juliapro\JuliaPro_v1.4.2-1\packages\RecipesPipeline\dZsrD\src\series.jl:27
 [4] macro expansion at C:\Users\...\.juliapro\JuliaPro_v1.4.2-1\packages\RecipesPipeline\dZsrD\src\series.jl:138 [inlined]
 [5] apply_recipe(::Dict{Symbol,Any}, ::Type{RecipesPipeline.SliceIt}, ::DataFrame, ::Type{T} where T, ::Nothing) at C:\Users\...\.juliapro\JuliaPro_v1.4.2-1\packages\RecipesBase\jcXIg\src\RecipesBase.jl:281
 [6] _process_userrecipes!(::Plots.Plot{Plots.GRBackend}, ::Dict{Symbol,Any}, ::Tuple{DataFrame,DataType}) at C:\Users\...\.juliapro\JuliaPro_v1.4.2-1\packages\RecipesPipeline\dZsrD\src\user_recipe.jl:35
 [7] recipe_pipeline!(::Plots.Plot{Plots.GRBackend}, ::Dict{Symbol,Any}, ::Tuple{DataFrame,DataType}) at C:\Users\...\.juliapro\JuliaPro_v1.4.2-1\packages\RecipesPipeline\dZsrD\src\RecipesPipeline.jl:67
 [8] _plot!(::Plots.Plot{Plots.GRBackend}, ::Dict{Symbol,Any}, ::Tuple{DataFrame,DataType}) at C:\Users\...\.juliapro\JuliaPro_v1.4.2-1\packages\Plots\V8QVi\src\plot.jl:167
 [9] plot(::DataFrame, ::Vararg{Any,N} where N; kw::Base.Iterators.Pairs{Symbol,Symbol,Tuple{Symbol,Symbol},NamedTuple{(:x, :y),Tuple{Symbol,Symbol}}}) at C:\Users\...\.juliapro\JuliaPro_v1.4.2-1\packages\Plots\V8QVi\src\plot.jl:57
 [10] top-level scope at none:0

```

(Where … fills in for my user name—I’m not sure what the convention is for writing the username here. If it’s relevant: I set the username up several years ago, and it has spaces in it, so the file path does too.)

I’m sure I’m missing something elementary, but googling isn’t turning anything up.

Thank you!

---

<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:** [July 1, 2020, 8:44pm UTC](https://discourse.julialang.org/t/gadfly-dataframe-cannot-convert/42383/2 "2020-07-01T20:44:44Z")

</div>

In [9], julia is calling `Plots.plot`, not `Gadfly.plot`. `Gadfly` and `Plots` are separate plotting packages, so you don’t need to be `using Plots` to use Gadfly. Or do you have another package loaded which loads `Plots`?

---

<div class="post-metadata">

**Author:** ![colinclout12](https://avatars.discourse-cdn.com/v4/letter/c/dfb087/32.png) [@colinclout12](https://discourse.julialang.org/u/colinclout12)\
**Post date:** [July 2, 2020, 12:13am UTC](https://discourse.julialang.org/t/gadfly-dataframe-cannot-convert/42383/3 "2020-07-02T00:13:58Z")

</div>

It looks like I’d loaded Plots on a separate tab (in Atom), and forgotten to restart the REPL. (Or rather, I’m just learning the importance of restarting the REPL.)

Thanks!
