# Ugly streaks caused by Arg in a contour plot

I had a more general question about a similar problem more than two years ago, Getting rid of discontinuities in plots caused by square roots, logarithms, Arg, etc, which got lots of interesting feedback but no definite answer.

So I decided to focus on something more obviously urgent and simple.

Here is the result of

ContourPlot[Log[Abs[Sinh[Sinh[x+I y]]]],{x,-4,4},{y,-4,4},
MeshFunctions->{Arg[Sinh[Sinh[#1+I #2]]]&},
Mesh->11,PlotPoints->150,Contours->50]


I guess I don't even need to ask: I want to get rid of those rough thick black lines, that's all.

PS Heard rumours that it might be incorporated in version 12. I have 11.0.1.0, but still, let me know if this is the case.

• Generally, MeshFunctions should be continuous. Discontinuities lead to such ugly streaks. Commented Feb 2, 2021 at 19:06

The problem is the discontinuity in Arg. One way to correct it is to apply a continuous periodic function (of period $$2\pi$$) to it. I used TriangleWave so that the differences between mesh lines would remain the same.

ContourPlot[Log[Abs[Sinh[Sinh[x + I y]]]],
{x, -4, 4}, {y, -4, 4},
MeshFunctions -> {TriangleWave[
Arg[Sinh[Sinh[#1 + I #2]]]/(2 Pi) - 1/24] &},
Mesh -> {1/6 + Range[-3, 2]/3},
PlotPoints -> 201, Contours -> 50]


Alternative

This takes a bit longer for a high-quality plot, but it shows the Arg[] nicely. A bit hard to figure out how to scale the ColorFunction, too.

ComplexPlot[Sinh[Sinh[z]], {z, -4 - 4 I, 4 + 4 I},
PlotPoints -> 801, Mesh -> {51, 1/6 + Range[-3, 2]/3},
MeshFunctions -> {Log@Abs[#2] &,
TriangleWave[Arg[#2]/(2 Pi) - 1/24] &},
MeshStyle -> Directive[Thin, GrayLevel[0.]],
ColorFunction -> {(Evaluate@

• Very clean solution, thanks! One correction though: I think you mean a continuous periodic function, since Arg itself is in fact periodic. Commented Feb 2, 2021 at 21:56