Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #13915 > unrolled thread

Re: RegionPlot and Show

Started byBob Hanlon <hanlonr357@gmail.com>
First post2013-03-23 07:24 +0000
Last post2013-03-31 07:10 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: RegionPlot and Show Bob Hanlon <hanlonr357@gmail.com> - 2013-03-23 07:24 +0000
    Re: RegionPlot and Show debguy <johnandsara2@cox.net> - 2013-03-31 07:10 +0000

#13915 — Re: RegionPlot and Show

FromBob Hanlon <hanlonr357@gmail.com>
Date2013-03-23 07:24 +0000
SubjectRe: RegionPlot and Show
Message-ID<kijlb6$is2$1@smc.vnet.net>
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
>

[toc] | [next] | [standalone]


#13968

Fromdebguy <johnandsara2@cox.net>
Date2013-03-31 07:10 +0000
Message-ID<kj8ngv$1qk$1@smc.vnet.net>
In reply to#13915
1.  Show[ A ] /; (* A is { A[[1]], A[[2]] } *)
     Show[ Table[A[i], {i,...}] (* A is a function A[1], A[2] ... *)

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.

I'm sure Bob may have answered.  ReUnion what is that?

RegionPLot only plots a List of "True" or "False" - it's simple - and
not a Union.   I'm unsure how Bob knows the inner structure of A since
you never mentioned it yet.  Union, Intersection, Complement: these
three can be combined to make any logic selections.  If, ie,
Union[ a[1], a[2] ] works depends on a.

That being so it doesn't make allot of sense to redo the logic of A[1]
A[2] after RegionPlot rather than before A[1] A[2] are made, since now
you have to hack the output syntax of RegionPlot[..][[1]]  (see below)

I mean:

p3=Module[{x,y},Plot3D[Sin[x] Exp[y], {x, -5, 5}, {y, -2,
2},PlotPoints->10]];
p4[[1]] = p3[[1]] .25 ;
Show[p3, p4];

shows p4 graphically smaller than p3.  The structure of Plot3D[...]
[[1]] allows multiplication directly (being a list, other Operators
could be applied).  RegionPlot[...][[1]] I'm unsure of the "Structure
of Graphics" of.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web