Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: coloring eveerything outside a circle

  • To: mathgroup at smc.vnet.net
  • Subject: [mg31818] Re: coloring eveerything outside a circle
  • From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
  • Date: Wed, 5 Dec 2001 06:51:40 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

mipam wrote:
>
> Is it possible with Mathematica to draw a circle, or 
> parametricplot and paint everything white outside that 
> circle, or closed curve (which is given by parametricplot)? 
> Or is it possible to paint everything white between two 
> closed curves or circles? 
>

Making something like a black inner tube (whith a white center) is trivial.
To do that you show a circle and then a smaller white circle on-top of the
first circle.  However, it's a little tricky if you want to "see" the
graphics behind the center of the inner tube.  Below I show how that can be
done. 
--------------------------

Block[{$DisplayFunction=Identity},
    gr1=ParametricPlot[ {2*Sin[t], 2*Cos[t]+2}, {t, 0, 2 Pi} ];
    gr2=ParametricPlot[ {Sin[t]+1/2, Cos[t]+2}, {t, 0, 2 Pi} ]
];

pnts=Join[ Part[gr1,1,1,1,1], Part[gr2,1,1,1,1] ];
gr3=Graphics[ { Hue[1], Polygon[pnts] } ];

gr4=Graphics[ { Hue[0.6], Polygon[ {{-2.5,3.75}, {-2.5,3.5}, {3,0.75},
{3,1}} ] }];

Show[{gr4,gr3}, AspectRatio->Automatic];


------------------
Regards,
   Ted Ersek
  Check Mathematica Tips, Tricks at
  http://www.verbeia.com/mathematica/tips/Tricks.html



  • Prev by Date: Fourier: Execution time for real and complex arguments
  • Next by Date: Surface graphics (Plot3D) colouring question
  • Previous by thread: Re: Fourier: Execution time for real and complex arguments
  • Next by thread: Re: coloring eveerything outside a circle