Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: RegionPlot and Show
Replies: 1   Last Post: Mar 23, 2013 3:24 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Bob Hanlon

Posts: 892
Registered: 10/29/11
Re: RegionPlot and Show
Posted: Mar 23, 2013 3:24 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Plot[
Evaluate[
Table[Tooltip[x^i], {i, 0, 3}]],
{x, 0, 1}]

plts = Table[a[i] =
Plot[Tooltip[x^i], {x, 0, 1},
PlotStyle -> Hue[i/4]],
{i, 0, 3}];

Show[plts, PlotRange -> {0, 1.1}]

Show[Table[a[n], {n, 0, 3}],
PlotRange -> {0, 1.1}]

offsets = RandomReal[1, {4, 2}];

plts = Table[RegionPlot[
(x - offsets[[i, 1]])^2 +
(y - offsets[[i, 2]])^2 < 2,
{x, -3, 3}, {y, -3, 3},
PlotStyle -> Opacity[.5, Hue[i/4]]],
{i, 4}];

Show[plts]

rgnUnion = RegionPlot[
Or @@ Table[
(x - offsets[[n, 1]])^2 +
(y - offsets[[n, 2]])^2 < 2,
{n, 4}],
{x, -3, 3}, {y, -3, 3},
PlotStyle -> Lighter[Blue, .6]]

rgnIntersect = RegionPlot[
And @@ Table[
(x - offsets[[n, 1]])^2 +
(y - offsets[[n, 2]])^2 < 2,
{n, 4}],
{x, -3, 3}, {y, -3, 3},
PlotStyle -> Lighter[Red, .4]]

Show[rgnUnion, rgnIntersect]


Bob Hanlon


On Fri, Mar 22, 2013 at 4:17 AM, Ilinca <ilinca.s@gmail.com> wrote:
> Hi All,
>
> I have a couple of questions.
>
> 1. If I generate a sequence of plots in a loop with index i and I name the plots A[i], can I use Show in a smarter way than actually listing all myself ?
> E.g., I would like that instead of
> Show[A[1],A[2], etc...]
> to be able to type something like
> Show[A[i] for all i in a range]
>
> 2. Now say that each A[i] is a regionplot. I would like to get their reunion.
> I know I can technically plot by overlapping all of them to get it but if there are many, the size of the resulting figure is too large due to many layers on top of each other.
>
> Thank you for any suggestion you may be able to offer
>
> Ilinca
>





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.