Question: How to plot (draw) an area efficiently?

I would like to draw some areas between curves. I tried to use ?plots/implicitplot but I often need to use gridrefine option which consumes so much memory. When I want to draw e.g. the area between f and g:

f := x-> piecewise(x < 5, 2, x-3):
g := x-> piecewise(x < 4, x, 4):

I can do:

p:=plot({f, g}, color = "NavyBlue", thickness = 2, view = [2 .. 7, 2 .. 4], scaling = constrained):
region := plots[implicitplot](0, x = 2 .. 7, y = f(x) .. g(x), color = cyan, gridrefine = 2):
plots[display](region, p);

which doesn't look "nice" without gridrefine=2. I can also do:

tr := plottools[transform]((x, y) -> [x, y+f(x)]):
q := plot(g(x)-f(x), x = 2 .. 7, filled = true, color = cyan):
plots[display](tr(q),p);

which is nice and fast. In this case I could also use ?plots/polygonplot , but it will not work for general curves.
Why is implicitplot so ineffective? Is it better to solve such problems with the help of plottols[transform]?

Please Wait...