Polar graph of the Riemann zeta function

I would like to plot a complex graph of the Riemann zeta function on the Argand diagram $$ς(s)$$, where $$s = \frac{1}{2} + i t$$, and the value of $$t$$ is varied to get a graph in the polar form.

The simplest way to get an expected plot exploits ParametricPlot and for the sake of clearer visualization we can take advantage of ListAnimate e.g.

anim = Table[
ParametricPlot[ReIm@Zeta[1/2 + I t], {t, 0, k},
PlotRange -> {{-2, 4}, {-2.3, 2.3}}, PlotStyle -> {Thick, Red},
ImageSize -> 500, PlotLegends -> Placed[Style[Row[{"t = ", k}],
Bold, 20], {Left, Top}]],
{k, 0.1, 50, 0.4}];

ListAnimate[ anim, ControlPlacement -> Top, Paneled -> False]


Analogous plots are sometimes called (see here) polar graphs although we have used ParametricPlot

ListAnimate aviods possible jumps in animations made with Animate, anyway with ListAnimate one can make a denser animation. ParametricPlot provides expected graphics. Another related plot of the Riemann Zeta function can be found here When does the real part of Zeta vanish on the critical line? while analogous usage of ParametricPlot and ListAnimate one can find here How to get intersection values from a parametric graph?

Let's compare behaviour of $$\zeta(\frac{1}{2}+i t)$$ for $$0 demonstrated above with that of $$t$$ between $$2018$$-th and $$2028$$-th zero on the critical line (see e.g. Automating interesting ways to write 2023).

N @ Im @ ZetaZero @ { 2018, 2028}

{2534.41, 2544.29}

anim1 = Table[
ParametricPlot[ ReIm @ Zeta[ 1/2 + I t], {t, 2534.40, k},
PlotRange -> {{-2, 8}, {-4, 6}}, PlotStyle -> Thick,
ColorFunction -> Function[{x, y, t}, ColorData["SolarColors"][t]],
PlotLegends -> Placed[Style[Row[{"t = ", k}], Bold, 20], {Left, Top}]],
{k, 2534.41, 2544.29, 0.1}];

ListAnimate[ anim1, ControlPlacement -> Top, Paneled -> False]


We have used ColorFunction and "SolarColors" to distinguish easily earlier and later times $$t$$, take care that the starting sector of the curve becomes more red and darker as long as we elongate range of the critical line.

There is another (quite different) approach for exploring Riemann zeta on the critical line, let's take a closer look at PolarPlot. In the following plot below the radial coordinate denotes the module of $$\zeta(\frac{1}{2}+i t)$$ while the angle $$\theta$$ in polar coordinates denotes "time" $$t$$.

There are infinitely many zeros on the critical line, while for $$0 there are $$2023$$ of them

N[ ZetaZero @ 2023, 10]

0.500000 + 2539.998407 I


and so interesting information on long ranges one can mine with the absolute value of $$\zeta(\frac{1}{2}+ i t)$$. On my machine (11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz 2.42 GHz, RAM 8GB) evaluating this plot took roughly 15-20 minutes. Nevertheless it rewards the effort (ByteCount of it yields 420301944) since we can precisely observe the fine structure of the plot which cannot provide exported graphics.

PolarPlot[ Abs @ Zeta[ 1/2 + I t], {t, 0, 2023},
PlotRange -> All, PerformanceGoal -> "Quality", Axes -> False,
PlotStyle -> Thickness[0.0005], PlotPoints -> 10000, MaxRecursion -> 15,
RegionFunction -> Function[{x, y, t, r}, 1/8 < r],
ColorFunction -> Function[{x, y, t, r}, ColorData["SolarColors"][t]],
Epilog -> {Cyan, Circle[]}]


Here the curve intersects itself $$2023$$ times in the origin, i.e. where Abs @ Zeta[1/2 + I t] vanishes. We have added cyan circle to denote complex numbers with module $$1$$ for an appropriate guage.

ClearAll["Global*"]
s[t_] := 1/2 + I*t
Manipulate[
tick;
Module[{x, y},
x = Re[Zeta[s[t]]]; y = Im[Zeta[s[t]]];
AppendTo[coord, {x, y}];
ListLinePlot[coord, AxesLabel -> {"Real part", "Imaginary part"},
PlotRange -> {{-3, 3}, {-3, 3}}, GridLines -> Automatic,
GridLinesStyle -> LightGray, PlotStyle -> Red]
],
Grid[{{Button[
Text@Style["clear", 12], {coord = {}; tick = Not[tick]},
ImageSize -> {60, 40}]}}],
{{t, 0, "t"}, 0, 20, .01, Appearance -> "Labeled"},
{{coord, {}}, None},
{{tick, False}, None},
TrackedSymbols :> {t, tick}
]


when i change the value of "t", the graph is not smooth at the beginning for a few values of t,

This is just how Zeta function is. You can see this more clearly by adding Mesh -> All to the above Plot command, which will now show the actual $$x+i y$$ points used and just the line that connects them.

It will show this

You see, that for small $$t$$, the points are more spread than for larger $$t$$. This is the nature of Zeta. Complain to Mr Riemann about this function :).

You can make the increment of $$t$$ much smaller to help reduce this problem. Say 0.0001 increment instead of 0.01 and this will make the line more smooth.

ClearAll["Global*"]
s[t_] := 1/2 + I*t
Manipulate[tick;
Module[{x, y}, x = Re[Zeta[s[t]]]; y = Im[Zeta[s[t]]];
AppendTo[coord, {x, y}];
ListLinePlot[coord, AxesLabel -> {"Real part", "Imaginary part"},
Mesh -> All, PlotRange -> {{-3, 3}, {-3, 3}},
GridLines -> Automatic, GridLinesStyle -> LightGray,
PlotStyle -> Red]],
Grid[{{Button[
Text@Style["clear", 12], {coord = {}; tick = Not[tick]},
ImageSize -> {60, 40}]}}], {{t, 0, "t"}, 0, 20, .0001,
Appearance -> "Labeled"}, {{coord, {}}, None}, {{tick, False},
None}, TrackedSymbols :> {t, tick}]

• thank you so much for you reply and time, but when i change the values the graph is not smooth is there any way to make it smoother ? Jan 25, 2023 at 6:20
• when i change the values the graph is not smooth what values and what changes? I can't guess. But you can always change the line {{t, 0, "t"}, 0, 20, .01 to make it move with smaller intervals than give above which is 0.01 unless you mean something else. Jan 25, 2023 at 6:22
• when i change the value of "t", the graph is not smooth at the beginning for a few values of t, is there any way to make it smoother ? Jan 25, 2023 at 6:30
• @keshavRamesh you can change {{t, 0, "t"}, 0, 20, .01 to {{t, 0, "t"}, 0, 20, .00001 that will make it little more smooth. The reason is, it is just how the Zeta function just works. Change ListLinePlot and add Mesh -> All to see why. It will display the points as well as the line itself. You will now see the points are more spread at the start for low $t$. This is just how Zeta function is. Jan 25, 2023 at 6:34
• yess i added Mesh -> All instead, but im not getting any graph when i do this Jan 25, 2023 at 6:53