如何使用子标题包修改位置标题?

如何使用子标题包修改位置标题?

如何垂直修改字幕?

在此处输入图片描述

代码如下

\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

您的示例中的单元格内容没有任何高度。您应该将每个单元格内容放在具有特定尺寸的单个 pspicture 环境中。

调整由您决定 ;-)

\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} 

编辑 @Mika:从评论来看,我觉得你不相信我。所以让我用一个简单的例子来向你展示这个问题。

让我们采取以下序列:a\psframe(0,0)(1,1)b——我认为您应该预期以下输出,即和a"frame"b之间的距离为 1cm。ab

但这是错误的。框架不是由 TeX 绘制的。因此,从 TeX 的角度来看,该命令\psframe没有宽度和高度。为了解决这个问题,环境pspicture用于保留所需的空间。

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

a\psframe(0,0)(1,1)b
\end{document}

相关内容