For a trivial example, suppose that \f(x) is a quadratic curve defined as follows
\def\f(#1){-#1*(#1-8)/4}
For each element \ix in {0,1,2,3,4,5,6,7,8} there is a point (\ix,\f(\ix)) that will be the center of a square of 1 cm square.
How to express the bottom-left & top-right points of \psframe in terms of \ix and \f(\ix)?
NOTE: Please don't suggest other simpler solutions such as using \rput to put the squares because I am interested in PSTricks point expression. RPN notation should be avoided if it is possible.
I give you the skeleton (not working) as below to save your time.
\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot}%loads multido automatically
\begin{document}
\def\f(#1){-#1*(#1-8)/4}
\begin{pspicture}
\multido{\ix=0+1}{9}{
% the following expression is wrong!
\psframe[dimen=middle](*\ix-0.5 {\f(x)-0.5})(*\ix+0.5 {\f(x)+0.5})
}
\psplot[algebraic]{0}{8}{\f(x)}
\end{pspicture}
\end{document}
The output I want to get is as follows:


