Lifting the Contours

Allan Hayes

Copyright Allan Hayes 1994

SetDirectory[" put your directory here "]

<<haypacks`ContourLines3D`

Additional Examples

A Transparent Sphere

sphere = 
	ParametricPlot3DContoured[
		{Sin[s] Cos[t], Cos[s] Cos[t], Sin[t]},
		{s,0,2Pi},{t,-Pi/2, Pi/2},
		ContourLift -> .7,
		Boxed -> False,
		Axes -> False,
		AmbientLight -> GrayLevel[.2]		
	] (*followed by some clipping*)

The Full Story

The contours have been pulled right off the sphere but with the right view point they seem to be still on it.

Show[
	Graphics3D[sphere], 
	ViewPoint->{3.265, 0.888, 0.042}
]

Some Uses of the Options

hourglass =
	ParametricPlot3DContoured[
	{t Sin[s] Cos[t], t Cos[s] Cos[t], Sin[t]},
	{s,0,2Pi},{t,-Pi/2, Pi/2},
	AxesLabel -> {"x", "y", "z"}
];

Show[hourglass, Surface -> False]

Show[hourglass, ContourLines -> False]

Show[hourglass, 
	PlotRange -> {All, {-.3,1.1},All},
	ViewPoint->{1.393, -2.988, -0.764}
]

Show[hourglass, Lighting -> False, ColorFunction->GrayLevel]

Show[hourglass, ContourColorFunction -> (Hue[0]&), Mesh -> True, 
	MeshStyle -> Hue[.7], ColorFunction -> (Hue[1/6]&)]

Show[hourglass,  ColorFunction -> (Hue[1-#]&), Lighting -> False]

The next example is definitely non-standard Ð  I put this feature in to allow the plot points to be altered while retaining any options that have been built up.

RePlot[hourglass, PlotPoints -> 13]

Additional Examples

Clear[f,x,y]
f[x_, y_] := 3 Exp[y] x - x^3 - Exp[3 y]

Clear[g]
g[x_, y_] := ArcTan[ f[Tan[x], Tan[y]] ]

Plot3DContoured[g[x,y],
	{x, -1.57, 1.57},{y, -1.57, 1.57},
	PlotPoints -> 50,
	ViewPoint -> {.5, 1.5, .2},
	Boxed -> False,
	AxesEdge -> {{1,-1},{1,-1},{-1,1}},
	Ticks -> {Automatic,Automatic,{-1.5,0,1.5}},
	Lighting -> True, AmbientLight -> GrayLevel[.9]]

ParametricPlot3DContoured[{a, t - a Sin[t], 1 - a Cos[t]},
	{a, 0, 2}, {t, 0., 5Pi},
	PlotPoints -> 40,
	BoxRatios -> {4, 5Pi, 3},
	Boxed -> False, Axes -> False,
	ViewPoint -> {1.8, 0, 1.7}]

Plot3DContoured[1/Abs[Zeta[x + I y]],
	{x, -4, 4}, {y, -10, 40},
	PlotPoints -> {70, 110},
	ViewPoint -> {7,2,3},
	PlotRange -> {0,5},
	Boxed -> False,
	AxesLabel -> {"x","y",None},
	AxesEdge -> {{1,-1},Automatic,Automatic},
	BoxRatios -> {5,10,2},
	Ticks -> {Automatic, Range[0,30,10], Range[0,4]}]