Since \foreach
loop does not accept values with decimal point; I faked the placing of decimal point in the x axis.
I could not accomplish that in the y axis since it uses negative values, in which case the negative sign is placed after the decimal point.
To fake using the negative values with decimal point I used the following code from the answer to this question
Is there a simpler way to automate this without installing additional packages (the computer in my workplace does not allow installing any program for security reason).
\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{verbatim}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{frame}[t]
\frametitle{}
\begin{tikzpicture}[scale=.9, transform shape]
\draw [thick] (0,0) -- (7,0);
\draw [thick] (0,0) -- (0,5);
%begin x/y tickmarks
\pgfmathsetmacro{\incrmnty}{.6}
\pgfmathsetmacro{\incrmntx}{1}
%begin y tickmarks
\begin{scope}[xshift=0, yshift=-.6cm]
\foreach[count=\j] \i in {-6,...,2}{
\ifnum\i=0
\draw[thick] (-.14,\j*\incrmnty) node[xshift=-.2cm]{0}coordinate(\i) -- +(0:.2);
\else
\ifnum\i=-6
\draw[thick] (-.2,\j*\incrmnty) node[xshift=-.28cm]{-.6}coordinate(\i) -- +(0:.2);
\else
\ifnum\i=-4
\draw[thick] (-.2,\j*\incrmnty) node[xshift=-.28cm]{-.4}coordinate(\i) -- +(0:.2);
\else
\ifnum\i=-2
\draw[thick] (-.2,\j*\incrmnty) node[xshift=-.28cm]{-.2}coordinate(\i) -- +(0:.2);
\else
\ifnum\i=2
\draw[thick] (-.2,\j*\incrmnty) node[xshift=-.28cm]{.2}coordinate(\i) -- +(0:.2);
\fi \fi \fi \fi\fi}
\end{scope}
%end y tick marks
%begin x tickmarks
\begin{scope}[xshift=-1cm, yshift=0cm]
\foreach[count=\j] \i in {0,...,6}{
\ifnum\i=0
\draw[thick] (\j*\incrmntx,0) -- +(-90:.2) node[yshift=-.26cm]{0}coordinate(\i);
\else
\draw [thick] (\j*\incrmntx,0) -- +(-90:.2) node[yshift=-.26cm]{.\i}coordinate(\i);
\fi}
\end{scope}
%end x tick marks
%end x/y tickmarks
\end{tikzpicture}
\end{frame}
\end{document}