MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: passing both arbitary and defined options


Hi,

the old package FilterOptions` is the bes solution, the new
clumsy FilterRules[] should do the same in a more long winded way.

Regards
   Jens

Eddie wrote:
> So I'm building a plotting function, and I want it to be able to inherit the same options that a ListPlot[] command can inherit, so my prototype looks like this:
> 
> NewPlot[data_List,options___Rule]:=Module[{},blah
> blah
> blah
> ListPlot[fancy stuff,options]
> ]
> 
> Here's the rub, if I additionally want to create a NewPlot-specific option, it doesn't mesh.  For example:
> 
> NewPlot[data_List,OptionsPattern[{newOption->newValue}],options___Rule] := etc
> 
> Options contains the rule for newOption when NewPlot is called with that option utilized, and ListPlot throws an error because it's not a recognized option for ListPlot.
> 
> Is there a way I can have my personally declared options and the wildcard options both present and working?  Is there a way to "Drop" the rule that matches the user-defined option from 'options'?
> 


  • Prev by Date: Re: passing both arbitary and defined options
  • Next by Date: Why does ImageCompose degrade the result and can you do anything
  • Previous by thread: Re: passing both arbitary and defined options
  • Next by thread: Re: passing both arbitary and defined options