ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 11 Jan 2014 21:10:21 +0100How to fill region between two graphs using different styles or patterns?https://ask.sagemath.org/question/10886/how-to-fill-region-between-two-graphs-using-different-styles-or-patterns/How to fill region between two graphs using different styles or patterns?Sat, 11 Jan 2014 14:17:07 +0100https://ask.sagemath.org/question/10886/how-to-fill-region-between-two-graphs-using-different-styles-or-patterns/Answer by kcrisman for <p>How to fill region between two graphs using different styles or patterns?</p>
https://ask.sagemath.org/question/10886/how-to-fill-region-between-two-graphs-using-different-styles-or-patterns/?answer=15910#post-id-15910For more details, you should go to [the plotting documentation](http://www.sagemath.org/doc/reference/plotting/sage/plot/plot.html) and search for "fill " - in particular, you can even fill between different functions using the function itself as the key value. And example from there:
sage: plot(1.13*log(x), 1, 100, fill = lambda x: nth_prime(x)/floor(x), fillcolor = 'red')Sat, 11 Jan 2014 21:10:21 +0100https://ask.sagemath.org/question/10886/how-to-fill-region-between-two-graphs-using-different-styles-or-patterns/?answer=15910#post-id-15910Answer by ndomes for <p>How to fill region between two graphs using different styles or patterns?</p>
https://ask.sagemath.org/question/10886/how-to-fill-region-between-two-graphs-using-different-styles-or-patterns/?answer=15908#post-id-15908Are you looking for something like this:
f(x) = -1/8*x^3+x
g(x) = 1/2*x
h(x) = 1/4*x^2
plot([f,g,h],-2,3,fill={0:g,1:h,2:0})Sat, 11 Jan 2014 17:19:53 +0100https://ask.sagemath.org/question/10886/how-to-fill-region-between-two-graphs-using-different-styles-or-patterns/?answer=15908#post-id-15908