# Dispatch with @userplot and external recipes

**URL:** https://discourse.julialang.org/t/dispatch-with-userplot-and-external-recipes/54045
**Category:** Visualization
**Tags:** plots, recipe
**Created:** [January 27, 2021, 10:38am UTC](https://discourse.julialang.org/t/dispatch-with-userplot-and-external-recipes/54045 "2021-01-27T10:38:19Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Libbum](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/libbum/32/3935_2.png) [@Libbum](https://discourse.julialang.org/u/Libbum)
#### Post date: [January 27, 2021, 7:54pm UTC](https://discourse.julialang.org/t/dispatch-with-userplot-and-external-recipes/54045/2 "2021-01-27T19:54:24Z")

</div>

OK, so I’ve solved this myself I think.

Part 1: rather than use `@userplot` I just made the functions that would have been generated by the macro manually, but made them dispatchable:

```julia
mutable struct PlotCustom{AbstractType}
    args::Any                                      
end
    
plotcustom(args...; kw...) = RecipesBase.plot(PlotCustom{typeof(args[1].count)}(args); kw...)
#etc

```

Part 2: So long as I’m `using GraphRecipes`, I can omit assigning a value to `seriestype`, and leave the last line of my recipe as an `<: AbstractGraph`. Then [the graph recipe](https://github.com/JuliaPlots/GraphRecipes.jl/blob/7346f8e7fa18a33a9848be19865bf468eaa2404d/src/graphs.jl#L947) will take over from there.

If anyone has a cleaner way of doing this I’d be interested to know!

---

_[View the full topic](https://discourse.julialang.org/t/dispatch-with-userplot-and-external-recipes/54045)._
