4

I have this code, and would like to know how to group many nodes.

enter image description here

How to do it?

I prefer grouping nodes calling nodes by name but... if it´s not possible, I was thinking about coding any similar to

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

with the option "linearc=0.2"

My code

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

use

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

enter image description here

  • Thank you, I have coded \pstriangle[fillstyle=solid,fillcolor=gris135,linestyle=dashed,linecolor=red,linewidth=0.06cm,linearc=0.4](0,-1.56)(5.0,4.2) and I like it, but.. Are there any option to grouping ... refering to many nodes? – Mika Ike May 31 '14 at 11:56
  • 1
    With \pspolygon you can use as may nodes as you like and fillstyle also works. – user2478 May 31 '14 at 12:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.