I'm trying to customize a plot function according to this code
myPlot[fun_, opts_: OptionsPattern[]] := Module[{cm = 72/2.54},
Show[fun, FilterRules[{opts}, Options[Plot]]]
];
myPlot[Plot[Sin[x], {x, 0, 1}], ImageSize -> 2 cm]
To make this works (try to substitute 2 cm
with 100 for instance) I have to ask FilterRules
to look for Plot
options instead of Show
options. This sound strange to me but is not the main problem. The main problem is that cm
is defined within the module and it is not evaluate properly when passed to ImageSize
option.
Could someone suggest a way to fix this?
Thanks
Options[Show]
and you'll see why you don't filter any $\endgroup$ – Jason B. Apr 13 '16 at 11:26