1

I am writing some code in which I combine a ParametricPlot[] with a RegionPlot[]. Mathematica is very good at figuring out appropriate bounds for the ParametricPlot[], and I would like to reuse the same bounds for creating the RegionPlot[]. How can I tell Mathematica to reuse the bounds?

David Zhang
  • 2,316
  • 15
  • 25

1 Answers1

2
Show[RegionPlot[x + y < 1/2, Evaluate[Sequence @@ MapThread[Join, {{{x}, {y}}, (PlotRange /. 
                                                            AbsoluteOptions[#, PlotRange])}]]], 
     #] &@ ParametricPlot[{Sin[u], Sin[2 u]}, {u, 0, 2 Pi}]

enter image description here

Dr. belisarius
  • 115,881
  • 13
  • 203
  • 453
  • The construction (PlotRange /. AbsoluteOptions[#, PlotRange]) can in fact be substituted, I think, by the much simpler PlotRange[#]. As far as I can tell this is not documented in the PlotRange documentation, but it does seem to work. – Emilio Pisanty Aug 20 '14 at 15:30
  • @episanty Efectivamente. I learnt about that in a recent answer here. Thanks! – Dr. belisarius Aug 22 '14 at 16:10