# How to label a figure and call it using the command \vcenter{\hbox{\includegraphics[height=…em]{C:/Users/abc/Documents/…}}}?

I am unable to give the figure a name or figure number using the following latex command for, instance: $\vcenter{\hbox{\includegraphics[height=6.6em]{C:/Users/abc/Documents/g2}}}$. Thanks

• Can you please make a complete minimal example? What's the reason for \vcenter? Are you using a figure environment? – egreg Mar 15 at 18:28
• @egreg $\vcenter$ is used just to center the argument and g2 is my figure's file name in my computer saved in C drive. – gete Mar 15 at 18:47
• That's clear. What's needed is to know where and how you use those commands. Please, add some context. – egreg Mar 15 at 18:49
• @David Carlisle sorry i am not familiar in drawing figures in normal latex constructs. – gete Mar 15 at 19:10
• @egreg I am using a software to draw figures and save into my computer and using the above latex commands, i am able to include my figures in latex file which runs successfully, but i couldn't name the figure and call it in the text to refer – gete Mar 15 at 19:15

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\centering
\includegraphics[height=6.6em]{example-image}
\caption{An example image\label{eximg}}
\end{figure}

Some text, see Figure \ref{eximg}.

\end{document}