Consider a function myFunc
with options
Options[myFunc] = {TellNoOne->True}; (* myFunc has some options *)
myFunc[a_, b_, OptionsPattern[]] :=
Module[{},
(* Do stuff with OptionValue[TellNoOne] and plot result *)
ListPlot[{a,b}, moreOptions] (* want to pass some options to ListPlot here *)]
I wish to pass options that will target myFunc
, like TellNoOne
, and I also want to be able to pass any option to ListPlot
that it accepts such as PlotRange->All
and others.
Function call example:
myFunc[1, 3, TellNoOne -> False, PlotRange -> All, Joined -> True, Framed -> True]
How can I pass myFunc
is own options plus others for ListPlot
?
myFunc[a_, b_, OptionsPattern[Join[Options[myFunc], Options[ListPlot]]]] := (* stuff *)
work for you? $\endgroup$FilterRules
like in this example from the documentationFilterRules[{PlotRange -> 3, MaxIterations -> 5}, Options[Plot]]
$\endgroup$