1

How to vertical modify the caption?

enter image description here

The code is

\documentclass[pstricks,border=12pt]{article}
\usepackage{pstricks,pst-node,pst-blur}
\usepackage{subcaption}
\usepackage[utf8]{inputenc}
\usepackage{eurosym}

\newpsobject{cnodeblue}{cnode}{fillstyle=solid,fillcolor=blue}
\newpsobject{cnodepink}{cnode}{fillstyle=solid,fillcolor=pink}
\newpsobject{cnodegreen}{cnode}{fillstyle=solid,fillcolor=green}
\newpsobject{psframegray}{psframe}{fillcolor=lightgray,linestyle=none,shadow,blur}

\definecolor{azultenue}{RGB}{65,170,193}
\definecolor{rojotenue}{RGB}{192,2,3}
\definecolor{naranjatenue}{RGB}{241,101,35}
\definecolor{verdetenue}{RGB}{144,169,61}
\definecolor{gris135}{RGB}{135,135,135}

\begin{document}

\begin{figure}[h!]
\centering
{


\psset{framearc=0.2, shadowcolor=black!70, shadowangle=-90, unit=1.0cm,nodesep=0.12cm}
%
\def\pscolhookii{\hskip 1cm}
\def\pscolhookiii{\hskip 1cm}
\begin{psmatrix}[rowsep=2.2, colsep=5.2]% defines the distance between two frames
 [name=Inicio] 
 \psframegray(-2.5,-2.5)(2.5,2.5)
%
 \rput(0,1.5){\circlenode[fillstyle=solid,fillcolor=azultenue]{p1}{\textcolor{black}{$p_1$}}}
%
 \rput(-1.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{c1}{\textcolor{black}{$c_1$}}}
 \rput(-0.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{c2}{\textcolor{black}{$c_2$}}}
%
 \psdots[dotsize=0.06](0.1,-1)
 \psdots[dotsize=0.06](0.4,-1)
 \psdots[dotsize=0.06](0.7,-1)
%
 \rput(1.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{cl}{\textcolor{black}{$c_\lambda$}}}
%
 \ncline[arcangle=0]{->}{p1}{c1}
 \nbput[nrot=:U,labelsep=0.075cm]{\small{$ \omega_{mut}$}}
%
 \ncline[arcangle=0]{->}{p1}{c2}
 \nbput[nrot=:U,labelsep=0.075cm]{\small{$ \omega_{mut}$} }
%
 \ncline[arcangle=0]{->}{p1}{cl}
 \nbput[nrot=:U,labelsep=0.075cm]{\small{$ \omega_{mut}$} }
\rput(0,-1.8){$\bullet$ Crear $\lambda$ mutantes de $p_1$}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
&[name=Conjunto]
\psframegray(-2.5,-2.5)(2.5,2.5)
\pstriangle[fillstyle=solid,fillcolor=gris135,linestyle=dashed,linecolor=red,linewidth=0.06cm,linearc=0.4](0,-1.56)(5.0,4.2)
%
 \rput(0,1.5){\circlenode[fillstyle=solid,fillcolor=azultenue]{p1}{\textcolor{black}{$p_1$}}}
%
 \rput(-1.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{c1}{\textcolor{black}{$c_1$}}}
 \rput(-0.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{c2}{\textcolor{black}{$c_2$}}}
%
 \psdots[dotsize=0.06](0.1,-1)
 \psdots[dotsize=0.06](0.4,-1)
 \psdots[dotsize=0.06](0.7,-1)
%
 \rput(1.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{cl}{\textcolor{black}{$c_\lambda$}}}

\rput(0,-1.8){$\bullet$ Evaluar Padres e Hijos}
\rput(0,-2.2){$\bullet$ Elegir el más apto del conjunto}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
&[name=EM]
\psframegray(-2.5,-2.5)(2.5,2.5)
%
 \rput(0,0){\circlenode[fillstyle=solid,fillcolor=verdetenue]{pnuevo}{\textcolor{black}{\hspace{0.36cm}}}}
%
\rput(0,-1.8){$\bullet$ El individuo elegido}
\rput(0,-2.3){ sustituirá a $p_1$}
\end{psmatrix}
\psset{linewidth=3pt, linecolor=red, arrows=->, nodesep=4pt,  linearc=0.25, angleB=180, shortput=nab, npos = 0.4,nodesep=2.6cm}
\ncline{Inicio}{Conjunto}
\ncline{Conjunto}{EM}

}
\caption{\vspace{4.5cm}Esquema $(1+\lambda)$}\label{1maslambda-ilustracion}
\end{figure}

\end{document} 

1 Answer 1

3

The cell contents doesn't have any height in your example. You should put every cell content in a single pspicture environment with the specific dimension.

The adjusting is yours ;-)

\documentclass[pstricks,border=12pt]{article}
\usepackage{pstricks,pst-node,pst-blur}
\usepackage{subcaption}
\usepackage[utf8]{inputenc}
\usepackage{eurosym}

\newpsobject{cnodeblue}{cnode}{fillstyle=solid,fillcolor=blue}
\newpsobject{cnodepink}{cnode}{fillstyle=solid,fillcolor=pink}
\newpsobject{cnodegreen}{cnode}{fillstyle=solid,fillcolor=green}
\newpsobject{psframegray}{psframe}{fillcolor=lightgray,linestyle=none,shadow,blur}

\definecolor{azultenue}{RGB}{65,170,193}
\definecolor{rojotenue}{RGB}{192,2,3}
\definecolor{naranjatenue}{RGB}{241,101,35}
\definecolor{verdetenue}{RGB}{144,169,61}
\definecolor{gris135}{RGB}{135,135,135}

\begin{document}

\begin{figure}[h!]
\centering

\psset{framearc=0.2, shadowcolor=black!70, shadowangle=-90, unit=1.0cm,nodesep=0.12cm}
%
\def\pscolhookii{\hskip 1cm}
\def\pscolhookiii{\hskip 1cm}
\begin{psmatrix}[rowsep=0.2, colsep=0.2]% defines the distance between two frames
 [name=Inicio] 
\begin{pspicture}[shift=-2.5](-2.5,-2.5)(2.5,2.5)
 \psframegray(-2.5,-2.5)(2.5,2.5)
%
 \rput(0,1.5){\circlenode[fillstyle=solid,fillcolor=azultenue]{p1}{\textcolor{black}{$p_1$}}}
%
 \rput(-1.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{c1}{\textcolor{black}{$c_1$}}}
 \rput(-0.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{c2}{\textcolor{black}{$c_2$}}}
%
 \psdots[dotsize=0.06](0.1,-1)
 \psdots[dotsize=0.06](0.4,-1)
 \psdots[dotsize=0.06](0.7,-1)
%
 \rput(1.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{cl}{\textcolor{black}{$c_\lambda$}}}
%
 \ncline[arcangle=0]{->}{p1}{c1}
 \nbput[nrot=:U,labelsep=0.075cm]{\small{$ \omega_{mut}$}}
%
 \ncline[arcangle=0]{->}{p1}{c2}
 \nbput[nrot=:U,labelsep=0.075cm]{\small{$ \omega_{mut}$} }
%
 \ncline[arcangle=0]{->}{p1}{cl}
 \nbput[nrot=:U,labelsep=0.075cm]{\small{$ \omega_{mut}$} }
\rput(0,-1.8){$\bullet$ Crear $\lambda$ mutantes de $p_1$}
\end{pspicture}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
&[name=Conjunto]
\begin{pspicture}[shift=-2.5](-2.5,-2.5)(2.5,2.5)
\psframegray(-2.5,-2.5)(2.5,2.5)
\pstriangle[fillstyle=solid,fillcolor=gris135,linestyle=dashed,linecolor=red,linewidth=0.06cm,linearc=0.4](0,-1.56)(5.0,4.2)
%
 \rput(0,1.5){\circlenode[fillstyle=solid,fillcolor=azultenue]{p1}{\textcolor{black}{$p_1$}}}
%
 \rput(-1.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{c1}{\textcolor{black}{$c_1$}}}
 \rput(-0.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{c2}{\textcolor{black}{$c_2$}}}
%
 \psdots[dotsize=0.06](0.1,-1)
 \psdots[dotsize=0.06](0.4,-1)
 \psdots[dotsize=0.06](0.7,-1)
%
 \rput(1.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{cl}{\textcolor{black}{$c_\lambda$}}}

\rput(0,-1.8){$\bullet$ Evaluar Padres e Hijos}
\rput(0,-2.2){$\bullet$ Elegir el más apto del conjunto}
\end{pspicture}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
&[name=EM]
\begin{pspicture}[shift=-2.5](-2.5,-2.5)(2.5,2.5)
\psframegray(-2.5,-2.5)(2.5,2.5)
%
 \rput(0,0){\circlenode[fillstyle=solid,fillcolor=verdetenue]{pnuevo}{\textcolor{black}{\hspace{0.36cm}}}}
%
\rput(0,-1.8){$\bullet$ El individuo elegido}
\rput(0,-2.3){ sustituirá a $p_1$}
\end{pspicture}
\\
\end{psmatrix}
\psset{linewidth=3pt, linecolor=red, arrows=->, nodesep=4pt,  linearc=0.25, angleB=180, shortput=nab, npos = 0.4,nodesep=2.6cm}
\ncline{Inicio}{Conjunto}
\ncline{Conjunto}{EM}

\caption{\vspace{4.5cm}Esquema $(1+\lambda)$}\label{1maslambda-ilustracion}
\end{figure}

\end{document} 

EDIT @Mika: Due to the comments I think you don't believe me. So let me show your the issue in a simple example.

Let us take the following sequence: a\psframe(0,0)(1,1)b -- I think you should expect the following output a"frame"b whereby the distance between a and b will be 1cm.

However this is wrong. The frame isn't drawn by TeX. So in the sense of TeX the command \psframe has no width and height. To fix this issue the environment pspicture is used to reserve the needed space.

\documentclass[11pt,a4paper]{article}
\usepackage{pstricks}
\begin{document}

a\psframe(0,0)(1,1)b
\end{document}
6
  • @herbert gives me the solution with \vspace{2.5cm} before caption
    – Mika Ike
    May 31, 2014 at 13:34
  • 1
    @MikaIke: This is a manual adjusting and a quick fix. I think a more elegant solution is my ;-) May 31, 2014 at 13:44
  • I can´t understand because I was using that \resizebox{8cm}{!}{....} many times since other people here tell me about that insctruction. I think that it doesn´t the reason of the error. Thank you.
    – Mika Ike
    May 31, 2014 at 14:14
  • 1
    @MikaIke: Please read my updated answer. May 31, 2014 at 14:32
  • 1
    @MikaIke: The trick with \resizebox is equal to pspicture. The contents is put in an extra box and scaled. :-) May 31, 2014 at 16:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .