# Dispatch on plot recipe

**URL:** https://discourse.julialang.org/t/dispatch-on-plot-recipe/60944
**Category:** General Usage
**Tags:** plots, recipe
**Created:** [May 11, 2021, 11:56am UTC](https://discourse.julialang.org/t/dispatch-on-plot-recipe/60944 "2021-05-11T11:56:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)
#### Post date: [May 11, 2021, 11:56am UTC](https://discourse.julialang.org/t/dispatch-on-plot-recipe/60944/1 "2021-05-11T11:56:16Z")

</div>

Hi,  
I have a problem with Plot recipe in Plots.jl. I have a plot for an abstracttype that I want to use for a concrete type. How can I do this?

```julia
RecipesBase.@recipe function Plots(contres::AbstractBranchResult)
    # do the plot of contres
end
# specialiation
RecipesBase.@recipe function Plots(contres::T) where {T :< AbstractBranchResult}
    # change some options and send it to the previous plot recipe
    contres
end

```

However, this is an infinite loop. I tried putting keywords arg to differentiate them but they get absorbed in the plot recipe (ie sent to plot, scatter…). If you have an idea, I am interested! (

Thank you for your help

---

<div class="post-metadata">

### Author: ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)
#### Post date: [May 11, 2021, 9:49pm UTC](https://discourse.julialang.org/t/dispatch-on-plot-recipe/60944/2 "2021-05-11T21:49:36Z")

</div>

Have you already checked this [related post](https://discourse.julialang.org/t/dispatch-with-userplot-and-external-recipes/54045/2) out?

---

<div class="post-metadata">

### Author: ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)
#### Post date: [May 12, 2021, 5:26am UTC](https://discourse.julialang.org/t/dispatch-on-plot-recipe/60944/3 "2021-05-12T05:26:08Z")

</div>

not until now, thanks
