RE : [mg93714] ContourPlot and ColorFunction Opaci
- To: mathgroup at smc.vnet.net
- Subject: [mg93747] RE : [mg93714] ContourPlot and ColorFunction Opaci
- From: "Jaccard Florian" <Florian.Jaccard at he-arc.ch>
- Date: Mon, 24 Nov 2008 06:45:11 -0500 (EST)
- References: <200811240910.EAA00749@smc.vnet.net>
I did not find a nice way...
But this works :
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"] /. GraphicsComplex[aa__] ->
{Opacity[0.2], GraphicsComplex[aa]}
Regards
Florian Jaccard
________________________________
De: alpinekarst [mailto:alpinekarst at gmail.com]
Date: lun. 24.11.2008 10:10
=C0: mathgroup at smc.vnet.net
Objet : [mg93714] ContourPlot and ColorFunction Opacity
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.
- References:
- ContourPlot and ColorFunction Opacity
- From: alpinekarst <alpinekarst@gmail.com>
- ContourPlot and ColorFunction Opacity