I just discovered the recipes mechanism in order to avoid having Plots
as a package dependency.
I currently have a plot1(x::TypeX,y::TypeY)
and plot2(x::TypeX,y::TypeY)
functions which help present the same data in a different manner. Both have their advantages and shortcomings, so I would like to keep both available.
Now that I want to switch my definitions to recipes, I figured I could replace the
function plot1(x::TypeX,y::TypeY)
<some plotting code>
end
definition to
@recipe function plot1(x::TypeX,y::TypeY)
<some equivalent recipe code>
end
The same goes for plot2
.
However, given the way recipes seem to works, the way to call this recipes is not plot1(X,Y)
and plot2(X,Y)
, but simply plot(X,Y)
for both, which makes one of the unavailable/overwritten.
I suppose I am not the first one to have this issue but I am confused… What is the correct way to avoid this. Using a @userplot
maybe useful, but I do not see how it fits here.
Thanks !