
A figure float in LaTeX is just a figure
environment (\begin{figure} ... \end{figure}
) but when you make a figure
float ("flotante" in the capture because the Spanish configuration) in LyX is also created a\caption{}
command inside (the "Figure n: [text]
" box) inside. Note that captions are optionals, so you can cut this box to have a figure without legend or even insert more that one caption in the same float.
The images, when translated to LaTeX language are \includegraphics{imagename}
commands that allowed inside or outside a float. Inside the float, the image could be before or after the caption. Inside a caption, an image is not allowed in LaTeX by default. However, LyX can force this position including a \protect
command.
Then you must care of the exact cursor position when inserting images. Insert the image
inside the float but above or below the caption
box. When the image was placed in the wrong position, just select only the image, cut it, move the cursor and paste in the right place.
Note that label
(\label{}
command in LaTeX) might also be inserted in any place in a float, but always place the labels inside or after the caption, never before, in order to avoid wrong cross-references.
With a mouse click then you can control the configuration of the image dimensions. Usually you may want the image centered making a selection with the cursor, and then with a right click selecting center justification. This put in the source code a center environment (\begin{center}
... \end{center}
) inside the float, but probably is better make an ERT box at the beginning of the float and write \centering
(that can produce a different result in terms of vertical spacing).
You can check in the menu View
that source LaTeX commands are in the correct order. A figure float with \centering
in an ERT box and the image above the caption, correctly labelled, should have this order:
\begin{figure}
\centering
\includegraphics{figure}
\caption{\label{fig:The-caption}The caption}
\end{figure}
I won't provide explanations but suggest you to read pgfmanual. There are nice tutorials there as commented by darthbith. What you want can be easily done.
\documentclass[tikz,border=4]{standalone}
\usepackage{siunitx}
\usetikzlibrary{positioning}
\tikzset{mynode/.style={draw,text width=1in,align=center}
}
\begin{document}
\begin{tikzpicture}
\node[mynode] (m){Mediator};
\node[mynode,below left=of m](a) {Variable A};
\node[mynode,below right=of m](b) {Variable B};
\draw[-latex] (a.north) -- node[auto,font=\footnotesize] {$b=-0.56$, $p=0.04$} (m.west);
\draw[-latex] (m.east) -- node[auto,font=\footnotesize] {$b=-0.44$, $p<0.001$} (b.north);
\draw[-latex] (a.east) --
node[below=3mm,font=\footnotesize,align=center] {Direct effect, $b=0.55$,
$p=0.03$ \\ Indirect effect, $b=0.16$, \SI{90}{\percent} CI [ 0.04,0.36]}
(b.west);
\end{tikzpicture}
\end{document}

Best Answer
No doubt you can use TikZ but if you just want to overlay text you don't need any extra packages at all
will write "hello" over your image.