Re: fill in harberger triangle
- To: mathgroup at smc.vnet.net
- Subject: [mg115574] Re: fill in harberger triangle
- From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
- Date: Sat, 15 Jan 2011 04:44:42 -0500 (EST)
- References: <igpbjo$fg9$1@smc.vnet.net>
I sent the wrong version. This is the one I intended a = 10.2; e = 1.5; q[p_] = a p^e; lowerBound = p /. Solve[q[p] == 100, p][[1]] // Quiet; Show[ Plot[q[p], {p, 0, 30}, PlotRange -> {0, Automatic}, Epilog -> {Line[{{0, 100}, {30, 100}}], Line[{{20, 0}, {20, q[30]}}]}], Plot[q[p], {p, lowerBound, 20}, Filling -> 100] ] Cheers -- Sjoerd On Jan 14, 12:21 pm, r_poetic <radford.scha... at mms.gov> wrote: > Hello, > while the Filling option for Plot is great, how can I use it (or > another feature of Mathematica 8) to fill in only the area between a > curve and a vertical line and a horizontal line? For instance, > between (1) the function Q= A * P ^ E, where A and E are given > constants, (2) a horizontal line e.g. P = 100, and (3) a vertical > line, e.g. Q = 20. The fill is only inside the triangle-like area. > This would be the "harberger triangle" showing consumer surplus in > economics. > > Thanks!