ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 11 Jan 2014 14:10:21 -0600How to fill region between two graphs using different styles or patterns?http://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 07:17:07 -0600http://ask.sagemath.org/question/10886/how-to-fill-region-between-two-graphs-using-different-styles-or-patterns/Answer by ndomes for <p>How to fill region between two graphs using different styles or patterns?</p>
http://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 10:19:53 -0600http://ask.sagemath.org/question/10886/how-to-fill-region-between-two-graphs-using-different-styles-or-patterns/?answer=15908#post-id-15908Answer by kcrisman for <p>How to fill region between two graphs using different styles or patterns?</p>
http://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 14:10:21 -0600http://ask.sagemath.org/question/10886/how-to-fill-region-between-two-graphs-using-different-styles-or-patterns/?answer=15910#post-id-15910