At least in v10.1 ContourPlot
doesn't supportRevising this answer I propose extracting contours from ScalingFunctions
ContourPlot
, but ListLinePlot
doesconverting to polar, unofficiallyscaling magnitude, then converting back and plotting. Therefore this might be of some I will use.
Using logscale
code from ListLogLinearPlot for the whole real numbers :
logify[_][x_ /; x == 0] := 0
logify[off_][x_] := Sign[x] Max[0, (off + Re@Log@x)/off]
inverse[off_][x_] := Sign[x] Exp[(Abs[x] - 1) off]
logscale[n_] := {logify[n], inverse[n]}
And an auxiliary function:
logTheta[m_][pts_] :=
(* additional definitionFromPolarCoordinates *)/@
logscale[n_, m_] := logscale MapAt[logify[m], ToPolarCoordinates /@ pts, {nAll, m1}];
cp = ContourPlot[
729 + x^4 + y^4 + 3 x^2 (-225 + y^2) == 730 y^2, {x, -32, 32}, {y, -34, 34},
MaxRecursion -> 3];
pts = Cases[Normal@cpCases[Normal @ cp, Line[x_] :> x, -3];
ListLinePlot[pts,ListLinePlot[logTheta[2] ScalingFunctions/@ ->pts
logscale[2, 2], AspectRatioTicks -> 1]
You can change the numeric parameters in logscale
to get different effects; see the linked post for further examples.
Working in polar coordinates makes things look nicer, but I lose automatic tick generation so I have to turn them off:
newpts = FromPolarCoordinatesCharting`ScaledTicks /@ logscale[2]
MapAt[logify[2], ToPolarCoordinates /@ pts, {All, All, 1}];
ListLinePlot[newpts, Ticks -> None, AspectRatio -> 1]1
]
The ticks could be calculated with inverse[2]
but I don't have timeAn additional example to complete that now.
Additional examples of each methodbetter illustrate variable "zoom" in the scaling:
cp2 = ContourPlot[
Evaluate[x^2 + y^2 == # & /@ (3^Range[-3, 5])], {x, -16, 16}, {y, -16, 16},
PlotPoints -> 50]
pts2 = Cases[Normal@cp2, Line[x_] :> x, -3];
ListLinePlot[pts2, ScalingFunctionsListLinePlot[logTheta[#] ->/@ logscale[3,pts2
3], AspectRatioTicks -> 1]
newpts2 = FromPolarCoordinatesCharting`ScaledTicks /@ logscale[#]
, AspectRatio MapAt[logify[3],-> ToPolarCoordinates1
] & /@ pts2, {All2, All3, 14}];
ListLinePlot[newpts2, Ticks -> None, AspectRatio
Beware: if the "zoom" is not enough you'll create singularities in the polar/Cartesian conversion and get errors instead of a plot:
logTheta[1] ->/@ Automatic]pts2;
FromPolarCoordinates::bdpt: Evaluation point {0,1.92728} is not a
valid set of polar or hyperspherical coordinates. >>
I expect this will be a problem if you have contours that cross the origin, but I will have to come back to that later.