Re: Transparent ContourPlot
- To: mathgroup at smc.vnet.net
- Subject: [mg123764] Re: Transparent ContourPlot
- From: Heike Gramberg <heike.gramberg at gmail.com>
- Date: Sun, 18 Dec 2011 04:34:19 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201112161052.FAA06915@smc.vnet.net>
To draw grid lines on top of the plot, you could use the (undocumented) option
Method->{"GridLinesInFront"->True}, so you could do something like
ContourPlot[x y^2 + 2, {x, -2, 2}, {y, -2, 2},
PlotRange -> {-10, 10},
Method -> {"GridLinesInFront" -> True},
GridLines -> Automatic]
If you still want to have a transparent shading, you probably want to set
Method -> {"TransparentPolygonMesh" -> True} as well which will get rid of the edges of
the individual polygons. You can combine these two options as follows
ContourPlot[x y^2 + 2, {x, -2, 2}, {y, -2, 2},
PlotRange -> {-10, 10},
Method -> {"GridLinesInFront" -> True, "TransparentPolygonMesh" -> True},
ColorFunction -> (Directive[Opacity[.5], ColorData["Rainbow"][#]] &),
ContourShading -> Automatic,
GridLines -> Automatic]
Heike
On 16 Dec 2011, at 11:52, dg wrote:
> I have been trying to create a contour plot where the contour shading is transparent, so that I can draw gridlines and see them through the contours. I can't seem to figure this one out....
>
> This produces a mess:
>
> ContourPlot[x y^2 + 2, {x, -2, 2}, {y, -2, 2}, PlotRange -> {-10, 10},
> ContourShading -> {Orange, Opacity[0.5]}]
>
- References:
- Transparent ContourPlot
- From: dg <davide.guarisco@gmail.com>
- Transparent ContourPlot