1
$\begingroup$

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?

$\endgroup$
3
  • $\begingroup$ If you mean PlotRange, then the function completePlotRange in this answer to How to get the real PlotRange using AbsoluteOptions? might be of interest. $\endgroup$
    – Michael E2
    Commented Nov 23, 2013 at 22:22
  • $\begingroup$ @MichaelE2 Doesn't seem necessary in this particular case $\endgroup$ Commented Nov 23, 2013 at 22:34
  • $\begingroup$ @belisarius I noticed, but I still thought it was a good reference for others, as well as a possible duplicate. $\endgroup$
    – Michael E2
    Commented Nov 24, 2013 at 0:15

1 Answer 1

2
$\begingroup$
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

$\endgroup$
2
  • $\begingroup$ 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. $\endgroup$ Commented Aug 20, 2014 at 15:30
  • $\begingroup$ @episanty Efectivamente. I learnt about that in a recent answer here. Thanks! $\endgroup$ Commented Aug 22, 2014 at 16:10

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.