Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

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


  • Prev by Date: Re: WAV Import[] and Integer16 Issue
  • Next by Date: Re: Mathematica daily WTF
  • Previous by thread: Re: texture for filling?
  • Next by thread: Re: Wolfram free input shortcut is "cntrl ="