using RecipesBase
struct DummyType end
@recipe function f(dummy::DummyType)
@series begin
seriestype := :contourf
color --> :bluesreds
[i+j for i in 1:10, j in 1:10]
end
end
It works fine as illustrated below:
using Plots; gr()
plot(DummyType())
However, if I try to set the default color map to something else like in
plot(DummyType(), color=:plasma)
the option doesn’t take effect, and I get back the same color map as before.
That’s because color isn’t the actual name of the attribute - the attribute is seriescolor and color is just a short alias for it. You should always use the full name of the attribute in a recipe (you can find that with plotattr("color")).
@recipe function f(dummy::DummyType)
@series begin
seriestype := :contourf
seriescolor --> :bluesreds
[i+j for i in 1:10, j in 1:10]
end
end
plot(DummyType(), color=:plasma)