Error plot not defined in RecipesBase

question
plotting

#1

Could you please help debugging this simple issue I am having trying to define a user plot recipe?

module FooPlots

using RecipesBase

@userplot FooPlot

@recipe function f(dr::FooPlot)
  # code goes here
end

end

using Plots
using FooPlots

fooplot()

ERROR: UndefVarError: plot not defined
Stacktrace:
 [1] #fooplot#1(::Array{Any,1}, ::Function) at /home/juliohm/.julia/v0.6/RecipesBase/src/RecipesBase.jl:340
 [2] fooplot() at /home/juliohm/.julia/v0.6/RecipesBase/src/RecipesBase.jl:340

What is missing?


#2

What version?


#3

julia> Pkg.status(“Plots”)

  • Plots 0.12.2

julia> Pkg.status(“RecipesBase”)

  • RecipesBase 0.2.1

#4

Oh, plot isn’t exported. Do import RecipesBase: plot.


#5

Could you please confirm this is a bug? I never had to export plot myself explicitly before.


#6

Using just RecipesBase? plot used to not exist in RecipesBase, so that couldn’t be the case.


#7

Yes, at least in both packages where I used it before, I only do

using RecipesBase

See GeoStats.jl and ImageQuilting.jl.


#8

#9

Thank you @ChrisRackauckas, on the spot as usual :slight_smile: