Или ваша проблема связана с отсутствующей скобкой:
for r in range (0, n+1):
xvalues.append(r * math.cos (math.tan * 1/n)
yvalues.append(r * math.sin (math.tan * 1/n)
Чтобы исправить:
for r in range (0, n+1):
xvalues.append(r * math.cos (math.tan * 1/n))
yvalues.append(r * math.sin (math.tan * 1/n))
Или / и из пробелов:
fig ax = plt.subplots()
ax.set title(f"Approx. with {n} points", fontsize=24)
ax.set xlabel("x", fontsize=14)
ax.set ylabel("y", fontsize=14)
Для заменить на:
ax = plt.subplots()
ax.set_title(f"Approx. with {n} points", fontsize=24)
ax.set_xlabel("x", fontsize=14)
ax.set_ylabel("y", fontsize=14)