Which coordinate is to be considered for the energy of simple pendulum? For an simple harmonic oscillator energy can be represented as in picture. Consider in particular picture (b) with the energy as a function of the coordinate $x$.

Consider now a simple pendulum. The coordinate $x$ in (b) is the coordinate of an horizontal axis (as in picture 1) or the coordinate or the circular trajectory, as in picture 2.

The motion of the pendulum is indeed a one dimensional simple armonic motion, but the path followed is circular, so I guess that the "$x$ coordinate" of the graph (b) is the one in picture 2. Is that correct?
 A: The potential energy of the pendulum is $U(θ)=mgl(1-\cos θ)$. For small angles, $U(θ)≈mglθ^2\!/2$ and you get a harmonic oscillator. So $θ$ (or equivalently $lθ$) may be taken as the oscillating variable. However, since we are considering small angles, we may as well use $x=l\sin θ≈lθ$.
Addendum: You may wonder which approximation is better.
Let's look at the next term of the Taylor series: $$1-\cos θ≈θ^2/2-θ^4/24.$$
Thus, taking $1-\cos θ≈θ^2/2$ overestimates by $θ^4/24$. Now, $$\sin θ≈θ-θ^3/6 → (\sin θ)^2/2≈θ^2/2-θ^4/6$$ so that taking $1-\cos θ≈(\sin θ)^2/2$ underestimates by $θ^4/6-θ^4/24=θ^4/8$. So, approximating by $θ^2/2$ is better than approximating by $(\sin θ)^2/2$.
A: The equation of motion for a simple pendulum is actually not the same as for a simple harmonic oscillator. In fact, the pendulum motion can is described by the differential equation
$$\frac{d^2\theta}{dt^2}+\frac{g}{l} \sin{\theta}=0$$
It is only in the small angle approximation (where $\sin{\theta} \approx \theta$) that this equates to a simple harmonic oscillator
$$\frac{d^2\theta}{dt^2}+\frac{g}{l} \theta=0$$
This means that a simple pendulum can not be accurately described as a simple harmonic oscillator for large swing amplitudes. One noticable effect is that for large angles, the oscillation period will depend on the deflection angle (this is not the case for a cycloidal pendulum). For a deflection angle of 10 degrees, the error will be 0.26% (see this site for a calculation).
Now, to answer your question: because we are only looking at small deflection angles, the motion of the end of the pendulum can be approximated as purely horizontal. Thus, you can ignore any curvature of the path of the pendulum and write its deflection as its $x$-coordinate only.
