I am trying to use the tikz package to draw this diagram:
This is what I have so far:
\documentclass[12pt]{article}
\usepackage{tikz}
\usepgflibrary{arrows}
\begin{document}
\begin{tikzpicture}
\node(1) at (0,0) [rectangle,draw]{};
\node at (0,-0.5) {$x_{j-1}$};
\node(2) at (2,0) [rectangle,draw]{};
\node at (2,-0.5) {$x_{j}$};
\node(3) at (4,0) [rectangle,draw]{};
\node at (4,-0.5) {$x_{j+1}$};
\node(4) at (6,0) [rectangle,draw]{};
\node at (6,-0.5) {$x_{j+2}$};
\node(5) at (8,0) [rectangle,draw]{};
\node at (8,-0.5) {$x_{j+3}$};
\node(6) at (0,2) [rectangle,draw]{};
\node(7) at (2,2.5) [rectangle,draw]{};
\node(8) at (4,2.3) [rectangle,draw]{};
\node(9) at (6,2.9) [rectangle,draw]{};
\node(10) at (8,2.7) [rectangle,draw]{};
\draw [<->](1) -- (2) node [midway,label=above:{$dx$}] {};
\draw (6) -- (7) -- (8) -- (9) -- (10);
\draw [->] (0,0) -- (xyz cs:x=1) node[above] {$x$};
\draw [->] (0,0) -- (xyz cs:y=1) node[right] {$f(x)$};
\end{tikzpicture}
\end{document}
Which yields something like this:
Unfortunately I have placed the node at the bottom left in coordinate (0,0). This forces the coordinate system to be placed with a coincident origin. If I try to move the origin up as such:
\draw [->] (0,3) -- (xyz cs:x=1) node[above] {$x$};
\draw [->] (0,3) -- (xyz cs:y=1) node[right] {$f(x)$};
I get a plot like this:
How can I shift the coordinate system up without losing its orthogonality?
Thanks



shift={(0,3)}. – Jun 26 '18 at 18:55