MathGroup Archive 2007

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

Search the Archive

Re: how fill PolarPlot?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg84429] Re: how fill PolarPlot?
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Mon, 24 Dec 2007 04:42:39 -0500 (EST)
  • References: <fkla2t$3sh$1@smc.vnet.net>

Murray Eisenberg wrote:
> I Mathematica 6 I have a PolarPlot, e.g., a 4-leaved rose:
> 
>    PolarPlot[Cos[2 theta], {theta, 0, 2 Pi}]
> 
> How can I fill the inside -- or, what I really want, just the leaf in 
> the right half-plane -- with some color?
> 

Hi,

Try this using ParametricPlot with two variables:

ParametricPlot[
  Cos[2 theta] {Cos[theta], Sin[theta]} r, {theta, 0, 2 Pi}, {r, 0, 1},
   Mesh -> False, PlotPoints -> {30, 2}]

For only filling the right-side leaf, there are probably better ways, 
but this works too:

g1 = PolarPlot[Cos[2 theta], {theta, Pi/4, 2 Pi - Pi/4}]
g2 = ParametricPlot[
   Cos[2 theta] {Cos[theta], Sin[theta]} r, {theta, -Pi/4, Pi/4},
   {r, 0, 1}, Mesh -> False]
Show[g1, g2, PlotRange -> All]

I hope this helps,
Szabolcs


  • Prev by Date: Re: Exact roots of transcedental functions
  • Next by Date: Bug in AbsoluteOptions, PlotRange when Using an Arrow
  • Previous by thread: Re: how fill PolarPlot?
  • Next by thread: Re: how fill PolarPlot?