TransWikia.com

Trouble with ParametricPlot and custom options

Mathematica Asked on January 1, 2021

Consider the following code:

Options[pl] = {lim->{0,1}};
pl[n_, OptionsPattern[]] := Plot[x^n, Join[{x}, OptionValue[lim]] ]

This function works as expected on 12.0: running something like pl[2] produces a plot over $[0,1]$, while pl[2, lim->{2,3}] uses the given limits.

But if I instead use ParametricPlot, as in

Options[pl] = {lim->{0,1}};
pl[n_, OptionsPattern[]] := ParametricPlot[{x,x^n}, Join[{x}, OptionValue[lim]] ]

then pl[2] just gives

System`SampledPlotsDump`iParametricPlot[{x, x^2}, Join[{x}, OptionValue[pl, {}, lim]]]

with a similar error message when explicitly including the option. What could be going on here? Why does ParametricPlot behave differently from Plot?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP