Re: inconsistent synatx for FillingStyle and PlotStyle? or How to
- To: mathgroup at smc.vnet.net
- Subject: [mg103147] Re: inconsistent synatx for FillingStyle and PlotStyle? or How to
- From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
- Date: Wed, 9 Sep 2009 04:43:59 -0400 (EDT)
- References: <h859rv$puq$1@smc.vnet.net>
Hi Nasser, This took me some time the find out myself. The hint in the FillingStyle documentation is the word 'default'. FillingStyle determines only the basic style for *all* fills. If you want to deviate from this default you have to specify this with Filling, like in the example below: ListPlot[{{{1, 1}}, {{2, 3}}, {{3, 3}}}, AxesOrigin -> {0, 0}, PlotStyle -> {Red, Blue, Green}, Filling -> {1 -> {Axis, Red}, 2 -> {Axis, Blue}, 3 -> {Axis, Green}}] Cheers -- Sjoerd On Sep 8, 11:58 am, "Nasser Abbasi" <n... at 12000.org> wrote: > Problem: Make a ListPlot, and have each Point be a different color. > Solution: Use Directive > > ListPlot[{{{1, 1}}, {{2, 3}}}, > PlotStyle -> {Directive[Red], Directive[Blue]}, > AxesOrigin -> {0, 0}] > > Problem : Make a ListPlot, but with vertical lines, and have each line be= a > different color. > > You would expect the synatx to be the same as above, just use Filling->Ax= is > and use FillingStyle-> insteadl of PlotStyle->, right? But it does not wo= rk > > Solution attempt: > > ListPlot[{{{1, 1}}, {{2, 3}}}, > Filling -> Axis, > FillingStyle -> {Directive[Red], Directive[Blue]}, > AxesOrigin -> {0, 0}] > > Now I looked at help, and it says: > > "Directives can be combined using Directive[g1,g2,....]" > > So, I tried this > > ListPlot[{{{1, 1}}, {{2, 3}}}, > Filling -> Axis, > FillingStyle -> Directive[Red, Blue], > AxesOrigin -> {0, 0}] > > And this did not work either. I also tried > > ListPlot[{{{1, 1}}, {{2, 3}}}, > FillingStyle -> {Red, Blue}, > AxesOrigin -> {0, 0}, > Filling -> Axis] > > I also tried > > ListPlot[{{{1, 1}}, {{2, 3}}}, > FillingStyle -> Directive[{Red, Blue}], > AxesOrigin -> {0, 0}, > Filling -> Axis] > > Am I getting any closer? I tried above 10 other ways, and can't get it to= do > this. so I give up :) > > Any idea how to make each vertical line be colored differently according = to > my own list of colors? > > thanks, > --Nasser