Hello,
I added new methods for plot
and histogram
to work with a custom type. Both methods work in isolation, but I cannot combine them by calling plot
and then histogram!
for example. How can I allow plot!
and histogram!
to work?
Below is a simplification of my problem. Most cases involve subplots, so I added those.
struct MyType end
import Plots: plot, histogram
function plot(::MyType)
plot(rand(2), title="MyType", layout=(2,1))
end
function histogram(::MyType)
histogram(rand(200), title="MyType", layout=(2,1))
end
Works:
plot(MyType())
Works:
histogram(MyType())
Fails:
plot(MyType())
histogram!(MyType())