Re: texture for filling?
- To: mathgroup at smc.vnet.net
- Subject: [mg115094] Re: texture for filling?
- From: DrMajorBob <btreat1 at austin.rr.com>
- Date: Thu, 30 Dec 2010 19:05:01 -0500 (EST)
FYI, there's a bit of redundancy in your RegionFunction: f1[x_] = Sin[x]; f2[x_] = Cos[x]; Plot[{f1[x], f2[x], Table[x/3 + b, {b, -3, 1, .1}]}, {x, 0, 2 Pi}, PlotRange -> {-1.05, 1.05}, PlotPoints -> 100, PlotStyle -> {Automatic, Automatic, Lighter[Gray]}, RegionFunction -> Function[{x, y}, (f1[x] >= f2[x] && f2[x] <= y <= f1[x]) || (f2[x] >= f1[x] && f1[x] <= y <= f2[x])]] Show[Plot[Table[x/3 + b, {b, -3, 1, .1}], {x, 0, 2 Pi}, PlotRange -> {-1.05, 1.05}, PlotPoints -> 100, PlotStyle -> Lighter[Gray], RegionFunction -> Function[{x, y}, f2[x] <= y <= f1[x] || f1[x] <= y <= f2[x]]], Plot[{f1[x], f2[x]}, {x, 0, 2 Pi}]] Bobby On Thu, 30 Dec 2010 03:12:49 -0600, Bob Hanlon <hanlonr at cox.net> wrote: > > f1[x_] = Sin[x]; > f2[x_] = Cos[x]; > > Plot[{f1[x], f2[x], > Table[x/3 + b, {b, -3, 1, .1}]}, > {x, 0, 2 Pi}, > PlotRange -> {-1.05, 1.05}, > PlotPoints -> 100, > PlotStyle -> {Automatic, Automatic, Lighter[Gray]}, > RegionFunction -> Function[{x, y}, > (f1[x] >= f2[x] && f2[x] <= y <= f1[x]) || > (f2[x] >= f1[x] && > f1[x] <= y <= f2[x])]] > > Show[ > Plot[ > Table[x/3 + b, {b, -3, 1, .1}], > {x, 0, 2 Pi}, > PlotRange -> {-1.05, 1.05}, > PlotPoints -> 100, > PlotStyle -> Lighter[Gray], > RegionFunction -> Function[{x, y}, > (f1[x] >= f2[x] && f2[x] <= y <= f1[x]) || > (f2[x] >= f1[x] && > f1[x] <= y <= f2[x])]], > Plot[{f1[x], f2[x]}, {x, 0, 2 Pi}]] > > > Bob Hanlon > > ---- agua <auguaylupo at gmail.com> wrote: > > ============= > Greetings to all. > It is possible that instead of using color, apply > some texture to fill an area between two curves. > For example, fill the region with slanted lines or dots instead of > gray: > > Plot[{Sin[x], Cos[x]}, {x, 0, 2 Pi}, Filling -> {1 -> {{2}, > Lighter[Gray]}}] > > Tk. > > -- DrMajorBob at yahoo.com