In the following code, how can nodes (containing triangles, squares and diamonds) be defined once for each, instead of repeating their definitions in every location?
\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{verbatim}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{tkz-fct}
\usepackage{gensymb}
\usetikzlibrary{arrows, arrows.meta, positioning, calc, intersections, decorations.pathreplacing, decorations.pathmorphing, decorations.markings, shapes, shapes.misc, shapes.symbols, shapes.geometric, patterns, backgrounds, trees, shadows}
\usetikzlibrary{decorations.shapes}
\begin{document}
\begin{frame}[fragile,t]
\frametitle{}
\tikzset{paintt/.style={ draw=#1, fill=#1},decorate with/.style={decorate, decoration={shape backgrounds, shape=#1, shape size=1mm}}}
\tikzset{paints/.style={ draw=#1, fill=#1},decorate with/.style={decorate, decoration={shape backgrounds, shape=#1, shape size=1mm}}}
\tikzset{paintd/.style={ draw=#1, fill=#1},decorate with/.style={decorate, decoration={shape backgrounds, shape=#1, shape size=1mm}}}
\begin{tikzpicture}[scale=.9, transform shape, paint/.style={thin, draw=#1!50!black, fill=#1!50 }]
\pgfmathsetmacro{\incrmnty}{1.}
\pgfmathsetmacro{\incrmntx}{.7}
\pgfmathsetmacro{\xlab}{1997}
\pgfmathsetmacro{\xn}{14}
\pgfmathsetmacro{\yn}{6}
\begin{scope}[xshift=0cm, yshift=0cm]
\foreach \x [evaluate=\x as \aff using int(\xlab+(1*\x))]in {0,...,\xn}{\draw [black!20!white] (\incrmntx*\x,0) node [black, xshift=0cm, yshift=-.68cm, rotate=90] {\footnotesize \aff} -- +(90:\incrmnty*\yn);}
\end{scope}
\begin{scope}[xshift=0cm, yshift=0cm]
\foreach \y [evaluate=\y as \aff using int(\y*100)]in {0,...,\yn}{\draw [black!20!white] (10,\incrmnty*\y) node [black, right] {\aff} --+(180:\incrmntx*\xn+.2);}
\end{scope}
\begin{scope}[xshift=0cm, yshift=0cm]
\draw [thick](0,0) -- (\incrmntx*\xn,0);
\draw [thick](\incrmntx*\xn,0) -- (\incrmntx*\xn,\incrmnty*\yn);
\end{scope}
\begin{scope}[xshift=0cm, yshift=0cm]
\draw [blue!30!white, ultra thick](0,\incrmnty*2.6) node [regular polygon,regular polygon sides=3, paintt=blue!30!white, scale=.2]{}% 97
-- ++(\incrmntx*1,.16*\incrmnty) node [regular polygon,regular polygon sides=3, paintt=blue!30!white, scale=.2]{}% 98
-- ++(\incrmntx*1,.1*\incrmnty) node [regular polygon,regular polygon sides=3, paintt=blue!30!white, scale=.2]{}%99
-- ++(\incrmntx*1,.06*\incrmnty) node [regular polygon,regular polygon sides=3, paintt=blue!30!white, scale=.2]{}%0
-- ++(\incrmntx*1,.16*\incrmnty) node [regular polygon,regular polygon sides=3, paintt=blue!30!white, scale=.2]{}%1
-- ++(\incrmntx*1,.18*\incrmnty) node [regular polygon,regular polygon sides=3, paintt=blue!30!white, scale=.2]{}%2
-- ++(\incrmntx*1,.1*\incrmnty) node [regular polygon,regular polygon sides=3, paintt=blue!30!white, scale=.2]{}%3
-- ++(\incrmntx*1,.1*\incrmnty) node [regular polygon,regular polygon sides=3, paintt=blue!30!white, scale=.2]{}%4
;
\end{scope}
\begin{scope}[xshift=0cm, yshift=0cm]
\draw [blue!60!black, ultra thick](0,\incrmnty*3.2) node [regular polygon,regular polygon sides=4, paints=blue!60!black, scale=.2]{}% 97
-- ++(\incrmntx*1,.2*\incrmnty) node [regular polygon,regular polygon sides=4, paints=blue!60!black, scale=.2]{}% 98
-- ++(\incrmntx*1,.1*\incrmnty) node [regular polygon,regular polygon sides=4, paints=blue!60!black, scale=.2]{}%99
-- ++(\incrmntx*1,.06*\incrmnty) node [regular polygon,regular polygon sides=4, paints=blue!60!black, scale=.2]{}%0
-- ++(\incrmntx*1,.18*\incrmnty) node [regular polygon,regular polygon sides=4, paints=blue!60!black, scale=.2]{}%1
-- ++(\incrmntx*1,.18*\incrmnty) node [regular polygon,regular polygon sides=4, paints=blue!60!black, scale=.2]{}%2
-- ++(\incrmntx*1,.08*\incrmnty) node [regular polygon,regular polygon sides=4, paints=blue!60!black, scale=.2]{}%3
-- ++(\incrmntx*1,.13*\incrmnty) node [regular polygon,regular polygon sides=4, paints=blue!60!black, scale=.2]{}%4
;
\end{scope}
\begin{scope}[xshift=0cm, yshift=0cm]
\draw [blue!80!white, ultra thick](0,\incrmnty*3.6) node [diamond, paintd=blue!80!white, scale=.2]{}% 97
-- ++(\incrmntx*1,.2*\incrmnty) node [diamond, paintd=blue!80!white, scale=.2]{}% 98
-- ++(\incrmntx*1,.1*\incrmnty) node [diamond, paintd=blue!80!white, scale=.2]{}%99
-- ++(\incrmntx*1,.06*\incrmnty) node [diamond, paintd=blue!80!white, scale=.2]{}%0
-- ++(\incrmntx*1,.18*\incrmnty) node [diamond, paintd=blue!80!white, scale=.2]{}%1
-- ++(\incrmntx*1,.18*\incrmnty) node [diamond, paintd=blue!80!white, scale=.2]{}%2
-- ++(\incrmntx*1,.08*\incrmnty) node [diamond, paintd=blue!80!white, scale=.2]{}%3
-- ++(\incrmntx*1,.13*\incrmnty) node [diamond, paintd=blue!80!white, scale=.2]{}%4
;
\end{scope}
\end{tikzpicture}
\end{frame}
\end{document}



pgfplots, where those marks are already defined? – Zarko Feb 08 '19 at 11:30