Re: inconsistent synatx for FillingStyle and PlotStyle? or How to
- To: mathgroup at smc.vnet.net
- Subject: [mg103145] Re: inconsistent synatx for FillingStyle and PlotStyle? or How to
- From: Armand Tamzarian <mike.honeychurch at gmail.com>
- Date: Wed, 9 Sep 2009 04:43:37 -0400 (EDT)
- References: <h859rv$puq$1@smc.vnet.net>
On Sep 8, 4: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 One way is simply to specify it with Filling: ListPlot[{{{1, 1}}, {{2, 3}}}, PlotRange -> {{0, 2}, {0, 3}}, Filling -> {{1 -> {0, Blue}}, {2 -> {0, Red}}}] I couldn't figure it out using FillingStyle Mike