在 pstricks 中如何对多个节点进行分组?

在 pstricks 中如何对多个节点进行分组?

我有这段代码,想知道如何对多个节点进行分组。

在此处输入图片描述

怎么做?

我更喜欢对节点进行分组,按名称调用节点,但是...如果不可能的话,我正在考虑编写类似以下的代码

\pstriangle[linestyle=dashed,linecolor=red,linewidth=0.1cm,framearc=0.2](0,-1.9)(4.8,4.8)

使用选项“linearc=0.2”

我的代码

\documentclass[pstricks,border=12pt]{article}
\usepackage{pstricks,pst-node,pst-blur}
\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}

\begin{document}
\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.8]% 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}$} }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
&[name=Conjunto]
\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$}}}
 \ncarcbox[nodesep=.2cm,boxsize=.4,linearc=.4,linecolor=red,linestyle=dashed]{<->}{p1}{c1}{c2}{cl}
\rput(0,-1.8){Evalución de Aptitud}
\rput(0,-2.25){de padres e hijos}

 \end{psmatrix}
\end{document} 

答案1

使用

\pspolygon[linearc=0.2,linestyle=dashed,linecolor=blue]%
  ([offset=10mm,nodesep=-4mm]p1)([offset=-5mm,nodesep=-13mm]c1)([offset=-5mm,nodesep=8mm]cl)

在此处输入图片描述

相关内容