MathGroup Archive 2005

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

Search the Archive

Re: Set default options for a function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg59242] Re: [mg59201] Set default options for a function
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Wed, 3 Aug 2005 01:19:47 -0400 (EDT)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

Needs["Graphics`MultipleListPlot`"];

Options[MultipleListPlot,
  {SymbolShape,PlotStyle,PlotJoined}]

{PlotJoined -> False, PlotStyle -> Automatic, SymbolShape -> Automatic}

SetOptions[MultipleListPlot,
    SymbolShape->None,
    PlotStyle->{{Red},{Blue},{Green},{Orange}},
    PlotJoined->True];

Options[MultipleListPlot,
  {SymbolShape,PlotStyle,PlotJoined}]

{PlotJoined -> True, PlotStyle -> {{RGBColor[1, 0, 0]}, {RGBColor[0, 0, 1]}, 
    {RGBColor[0, 1, 0]}, {RGBColor[1, 0.5, 0]}}, SymbolShape -> None}


Bob Hanlon

> 
> From: Daniele Lupo <danwolf_no_spam_please_ at libero.it>
To: mathgroup at smc.vnet.net
> Date: 2005/08/02 Tue AM 12:42:25 EDT
> Subject: [mg59242] [mg59201] Set default options for a function
> 
> Hi.
> 
> I've created (after some effort), a function that plot into a Smith chart a
> set of data.
> 
> In this function, all works OK, but I'd like to set default options for
> MultipleListPlot in a different way.
> 
> My function in made in this way:
> 
> MultipleListSmith[lista_List,options___] :=
> Module[{listaUV},
> ....I modify listaUV here...
> MultipleListPlot[listaUV, options]
> ]
> 
> now, my data by default is created by four sets of xy data
> {{data1},{data2},{data3},{data4}}, so I must to do four plots with
> MultipleListPlot.
> 
> I't works all (now...), but I'd like to create, by default, four different
> styles for every plot, in this way:
> 
> SymbolShape->None, PlotStyle->{{Red},{Blue},{Green},{Orange}},
> PlotJoined->True
> 
> I'd like that these options are used by default, changing them when I need
> other styles (considering that lista represents four data sets, by
> default).
> I've used the default value
> 
> options___:{PlotJoined -> True, SymbolShape -> None, PlotStyle -> {{Red},
> {Blue}, {Green}, {Orange}}}
> 
> But it does not work, returning the plot with default options, not mine...
> 
> I've also tried the example shown in the mathematica book of the online
> help 2.3.10, so, I've written:
> 
> Options[MultipleListSmith] = {PlotJoined -> True, SymbolShape -> None,
> PlotStyle -> {{Red}, {Blue}, {Green}, {Orange}}};
> 
> MultipleListSmith[lista_List, options___]:=
> Module[
> .....
> MultipleListPlot[
> listaUV,
> PlotStyle /. {options} /. Options[MultipleListSmith],
> PlotJoined /. {options} /. Options[MultipleListSmith],
> SymbolShape /. {options} /. Options[MultipleListSmith]
> ]
> ]
> 
> but it returns errors to me, of this type:
> 
> MultipleListPlot::badargs :
> MultipleListPlot has been given bad arguments. Input Should be data sets
> consisting of points or points with ErrorBar specifications.
> 
> If I replace my last three arguments with options, all works fine, but I
> don't have dafault values that I wants...
> 
> Anyone can help me?
> 
> Thanks for your answers
> 
> Daniele
> 
> 


  • Prev by Date: Re: Set default options for a function
  • Next by Date: Re: Set default options for a function
  • Previous by thread: Re: Set default options for a function
  • Next by thread: Re: Set default options for a function