import mpmath
import numpy as np
from matplotlib import pyplot as plt
plt.rcParams['svg.fonttype'] = 'path'
x = np.linspace(-30, 30, 300)
y = [complex(1,1)]*len(x)
for p, xx in enumerate(x):
t = mpmath.nstr(mpmath.mpc(0.5 + xx*1j))
y[p] = mpmath.zeta(t)
fig = plt.figure(figsize=[13,6])
ax = fig.add_subplot(111)
ax.spines['left'].set_position('zero')
ax.spines['right'].set_color('none')
ax.spines['bottom'].set_position('zero')
ax.spines['top'].set_color('none')
ax.spines['left'].set_smart_bounds(True)
ax.spines['bottom'].set_smart_bounds(True)
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
ax.text(-25,2.7, '$\\Re\\left[\\zeta\\left(\\frac{1}{2}+ix\\right)\\right]$', size='xx-large', color='red')
ax.text(-15,2.7, '$\\Im\\left[\\zeta\\left(\\frac{1}{2}+ix\\right)\\right]$', size='xx-large', color='blue')
ax.plot(x, [yy.real for yy in y], label='Real', color='red')
ax.plot(x, [yy.imag for yy in y], label='Imag', color='blue')
# ax.legend(loc=(.6,.8))
ax.minorticks_on()
ax.grid(b=True, which='major', ls='-', lw=1.5)
ax.grid(b=True, which='minor', ls='--', lw=.5)
fig.savefig('RiemannCriticalLine.svg', bbox_inches='tight')