Ask Your Question

Revision history [back]

You can use region_plot (documentation is on the page https://doc.sagemath.org/html/en/reference/plotting/sage/plot/contour_plot.html, but I don't see how to link directly to that particular part of the page).

sage: var('y')
y
sage: region_plot([y < y1, y > y2, y > y3], (x, -1, 6), (y, -4, 10))

will produce a filled triangle. To combine with the previous plot, add them:

sage: P = plot([y1,y2,y3], (x,-1,6), ymax=10, ymin=-4,gridlines='minor')
sage: Q = region_plot([y < y1, y > y2, y > y3], (x, -1, 6), (y, -4, 10))
sage: P + Q