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?
$\begingroup$
$\endgroup$
3
1 Answer
$\begingroup$
$\endgroup$
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}]
-
$\begingroup$ The construction
(PlotRange /. AbsoluteOptions[#, PlotRange])
can in fact be substituted, I think, by the much simplerPlotRange[#]
. As far as I can tell this is not documented in thePlotRange
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
PlotRange
, then the functioncompletePlotRange
in this answer to How to get the real PlotRange using AbsoluteOptions? might be of interest. $\endgroup$