Re: A Question About Directive
- To: mathgroup at smc.vnet.net
- Subject: [mg111234] Re: A Question About Directive
- From: Helen Read <hpr at together.net>
- Date: Sat, 24 Jul 2010 05:08:33 -0400 (EDT)
- References: <i2btei$bff$1@smc.vnet.net>
- Reply-to: HPR <read at math.uvm.edu>
On 7/23/2010 7:12 AM, Murray Eisenberg wrote: > Good example! Of course one _could_ still dispense with Directive in the > first one, using instead... > > Plot[{Cos[x], Sin[x]}, {x, 0, 2 Pi}, PlotStyle -> {{Thick, Red}}] > > ... with the nested PlotStyle value. And here, too, the point is that > Directive provides a convenience of eliminating nested braces. > > Just because a function such as Directive in such situations is a mere > convenience and not indispensable does not militate against its > existence. After all, some other newer functions such as Total or > Accumulate are also dispensable but nonetheless conveniences. > > If you want to stick with fewer functions, just go ahead and use the > nested parentheses. Brett Champion's post from 7/22 sheds light on this. He explains that Directive is intended to remove ambiguity. The old behavior in Plot (and other existing functions) has been kept for legacy reasons. Most of the new functions require Directive for specifying multiple styles for a single item. Try Brett's example: BarChart[Range[5], ChartStyle -> {Orange, EdgeForm[Thick]}] BarChart[Range[5], ChartStyle -> {{Orange, EdgeForm[Thick]}}] Compare: BarChart[Range[5], ChartStyle -> Directive[Orange, EdgeForm[Thick]]] -- Helen Read University of Vermont