Re: ContourPlot and ColorFunction Opacity
- To: mathgroup at smc.vnet.net
- Subject: [mg93749] Re: ContourPlot and ColorFunction Opacity
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Mon, 24 Nov 2008 06:45:33 -0500 (EST)
- Organization: Uni Leipzig
- References: <ggdqq9$k5$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
Hi,
if you don't like to define your own color function
ContourPlot[Cos[x y], {x, -Pi, Pi}, {y, -Pi, Pi},
GridLines -> Automatic,
RegionFunction -> Function[{x, y, z}, Pi < x^3 + y^3 < Pi^3],
BoundaryStyle -> Red,
ColorFunction -> "TemperatureMap"] /. {EdgeForm[], c_RGBColor,
g_GraphicsGroup} :> {EdgeForm[], Append[c, 0.5], g}
will work
Regards
Jens
alpinekarst wrote:
> Dear All,
>
> I am hoping that one of the Gurus here can help me figure out how to
> adjust the opacity for a ContourPlot ColorFunction in Mathematica 6.0.3
>
> say for example I have a 2D ContourPlot plot such as:
>
> ContourPlot[Cos[x y], {x, -Pi, Pi}, {y, -Pi, Pi},
> GridLines -> Automatic,
> RegionFunction -> Function[{x, y, z}, Pi < x^3 + y^3 < Pi^3],
> BoundaryStyle -> Red, ColorFunction -> "TemperatureMap"]
>
> How can I adjust the Opacity of the filled region so that the
> gridlines are somewhat visible within the boundary defined by the
> RegionFunction? Using a constant would be fine or even better some
> generic decay function from the centroid of the region.
>
> I have tried defining the opacity in the color function multiple ways
> such as:
> {Directive[Opacity[0.5]], ColorData["TemperatureMap"][#1] &}
> but keep getting BoxForm and Graphics Directive errors.
>
> I'm thinking of resorting to replacement rules against AbsoluteOptions
> but that's bound to get ugly and I am hoping that there is a better
> way? This is probably quite simple...but not for me today.
>
> Thanks.
>