MathGroup Archive 2010

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

Search the Archive

Re: Matching FillingStyle to PlotStyle

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107645] Re: [mg107626] Matching FillingStyle to PlotStyle
  • From: "David Park" <djmpark at comcast.net>
  • Date: Sun, 21 Feb 2010 04:24:56 -0500 (EST)
  • References: <6527985.1266666572687.JavaMail.root@n11>

Easy with the Presentations package.

Needs["Presentations`Master`"]

Draw2D[
 {Table[
   fillcolor = ColorData[3, "ColorList"][[n + 1]];
   Draw[Sin[x + \[Pi] n/4], {x, 0, 2 \[Pi]},
    Filling -> Axis,
    FillingStyle -> Directive[Opacity[.3, fillcolor]],
    PlotStyle -> Directive[Opacity[1, fillcolor]]], 
   {n, 0, 7}]},
 Frame -> True] 

That's the way I figured it out. But this can also be down with regular
Show.

Show[
 {Table[
   fillcolor = ColorData[3, "ColorList"][[n + 1]];
   Plot[Sin[x + \[Pi] n/4], {x, 0, 2 \[Pi]},
    Filling -> Axis,
    FillingStyle -> Directive[Opacity[.3, fillcolor]],
    PlotStyle -> Directive[Opacity[1, fillcolor]]],
   {n, 0, 7}]},
 Frame -> True] 

Frame plots are much better than Axes plots.


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  




From: Fabrice P. Laussy [mailto:fabrice.laussy at google.mail.com] 

How to use filling colors that are consistent with plot style colors 
when those are not the default?

When I use a given PlotStyle for the curve color, I would like the 
filling to be the same. However:

Plot[Evaluate[Table[Sin[x + Pi n/4], {n, 0, 7}]], {x, 0, 2 Pi},
  Filling -> Axis, PlotStyle -> ColorData[3, "ColorList"]]

doesn't adjust the filling. If I try to force it by hand, I loose opacity:

Plot[{Cos[x], Sin[x]}, {x, 0, 2 Pi},
  Filling -> {
    1 -> {0, ColorData["TemperatureMap"][.1]},
    2 -> {0, ColorData["TemperatureMap"][.8]}
    }
  ]

Best,

Fabrice.




  • Prev by Date: Re: multiple variables in pure function used in map.
  • Next by Date: Re: Re: Re: Arctangent approximation
  • Previous by thread: Matching FillingStyle to PlotStyle
  • Next by thread: Poisson-Boltzmann equation