I want to adjust the position of rectangle in the caption of a tikz figure.
It should be go down slightly. Also in caption, it is coming "Fig.X 1-". I want to remove
extra "1 -". How to do these? This is my code
\documentclass[preview]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
%\usepackage{caption}
\usepackage[labelsep=endash]{caption}
\renewcommand{\figurename}{Fig X.}
\begin{document}
\begin{figure}
\begin{tikzpicture}[scale=0.18]
\foreach \x in {1,...,50}
\fill[red] (1.1*\x,3) rectangle (1.1*\x+1,0);
\foreach \x in {1,5,7,10,16,22}
\fill[blue] (1.1*\x,3) rectangle (1.1*\x+1,0);
\foreach \x in {2,14,35,44,46}
\fill[green] (1.1*\x,3) rectangle (1.1*\x+1,0);
\end{tikzpicture}
\caption{ \begin{tikzpicture}[scale=0.18] \fill[gray!=10] (0, 3 ) rectangle (0.75, 0 ); \end{tikzpicture}: X }
\end{figure}
\end{document}