Message Boards Message Boards

GROUPS:

pass on options to ListPlot

Posted 10 years ago
2837 Views
|
1 Reply
|
1 Total Likes
|
Why are the options not getting to ListPlot?
Options[f] = Flatten[{Flatten[Options /@ {ListPlot}, 1]}, 1];
f[x_, opts : OptionsPattern[]] :=
Module[
  {},
  Print[Evaluate[FilterRules[{opts}, Options[ListPlot]]]];
  ListPlot[x,
   PlotStyle -> Evaluate[FilterRules[{opts}, Options[ListPlot]]]
   ]
  ]
f[{1, 3, 5}]
f[{1, 3, 5}, Joined -> True, PlotStyle -> Red]
Attachments:
POSTED BY: Jeff Burns
Options[f] = Options[ListPlot];

f[x_, opts : OptionsPattern[]] := ListPlot[x, FilterRules[{opts}, Options[ListPlot]]]
POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract