Ask Your Question
1

How to fill region between two graphs using different styles or patterns?

asked 2014-01-11 07:17:07 -0500

ajit gravatar image

updated 2015-01-14 04:57:24 -0500

FrédéricC gravatar image

How to fill region between two graphs using different styles or patterns?

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
1

answered 2014-01-11 10:19:53 -0500

ndomes gravatar image

Are 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})
edit flag offensive delete link more
1

answered 2014-01-11 14:10:21 -0500

kcrisman gravatar image

For more details, you should go to the plotting documentation 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')
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-01-11 07:17:07 -0500

Seen: 163 times

Last updated: Jan 11 '14

Related questions