2
$\begingroup$

I want to demonstrate the fact that the main part of a Mandelbrot fractal is consisted of a cardioid and some circles. So at first, I wrote this line:

With[{cardiod = PolarPlot[(1 - Cos[t])/2, {t, -Pi, Pi},
  Axes -> False, PlotStyle -> Directive[Thick, Red]]}, 
 Show[{MandelbrotSetPlot[], cardiod}]]

which results in

mandelbrot

But if I Translate the cardioid to right, it won't be recognized as a Graphics object. For example

Show[{MandelbrotSetPlot[], Translate[cardiod, {1/4, 0}]}]

results in an error saying Could not combine the graphics objects. I also looked at this question and other linked ones and tried something like this:

p = PolarPlot[(1 - Cos[t])/2, {t, -Pi, Pi},
   Axes -> False, PlotStyle -> Directive[Thick, Red]];
g = Graphics[Translate[p, {1/4, 0}][[1]]];
Show[{MandelbrotSetPlot[], g}]

but again, it doesn't work.

$\endgroup$

2 Answers 2

2
$\begingroup$
Show[{
  MandelbrotSetPlot[], 
  Graphics @ Translate[cardiod[[1]], {1/4, 0}]}]

enter image description here

$\endgroup$
2
  • $\begingroup$ Thanks. Could you explain why we should do this? $\endgroup$
    – polfosol
    Nov 4, 2023 at 15:00
  • $\begingroup$ cardiod[[1]] to get the graphics primitives and Graphics to convert the translated primitives (a line through many points with color and thickness specifications) back to a Graphics object. It should become clear when you look up Translate in the documentation and inspect the output of cardiois[[1]]. $\endgroup$
    – eldo
    Nov 4, 2023 at 15:16
1
$\begingroup$

If you choose an {x,y} parametrization and "ParametricPlot", then you can simply add some vector for a translation:

cardiod = 
 ParametricPlot[{1/4 + 0.5 (1 - Cos[ph]) Cos[ph],  0.5 (1 - Cos[ph]) Sin[ph]}, {ph, 0, 2 Pi}, 
Axes -> False, PlotStyle -> Directive[Thick, Red]]; 

Show[{MandelbrotSetPlot[], cardiod}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.