# How to plot on a curved plane? [duplicate]

I'm ploting the phase space of a pendulum problem using a symplectic Euler scheme.

$$\qquad H = \frac{1}{2}p^2 - \cos q$$, where $$\dot{p}=-\sin q$$ and $$\dot{q}=p$$

h=0.2; (*time step*)
p[0]=0.0; (*initial conditions*)
q[0]=0.5;

p[i_] := p[i] = p[i - 1] - h*Sin[q[i - 1]];
q[i_] := q[i] = q[i - 1] + h*p[i - 1] - h^2*Sin[q[i - 1]];

ListPlot[Table[{p[i], q[i]}, {i, 0, 100}], Frame -> True]

gives

Since the vector field is $$2π$$-periodic in q, it is natural to consider q as a variable on the circle $$S^1$$, I'd expect it to look something like

Any suggest how to do it?

• There is no such thing as a "curved plane". If want to plot on a 2-manifold, please give a description of the manifold in Wolfram Language code. – m_goldberg Apr 6 '19 at 5:52
• @MichaelE2 it is indeed a duplicate, I'm happy with the solution provided, feel free to close it. – Gvxfjørt Apr 8 '19 at 1:46