4

How to put a "coil" in an \ncline between nodes?

similar to: enter image description here

I have viewed \pscoil and options as coilarm=0.5,..

but.... in \ncline or similars?, how?

I have this code, for example

\documentclass[12pt,a4paper,x11names]{article}
\usepackage{pstricks,pst-node,pst-blur,pstricks-add}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage[utf8]{inputenc}
\usepackage{eurosym}
\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}

\vspace{2.1cm}
 \begin{figure}[h!]
\centering

\resizebox{10cm}{!}{

\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=5.2]% defines the distance between two frames
&
&
\\[2.5cm]
 [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$}}}
 \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,-3.0){$\bullet$ Crear $\lambda$ mutantes de $p_1$}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
&[name=Conjunto]
\psframegray(-2.5,-2.5)(2.5,2.5)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
&[name=EM]
\psframegray(-2.5,-2.5)(2.5,2.5)
%
%
\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}
}

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

\vspace{1cm}

\end{document} 
2

It is possible to use the same node for a line. The different coordinates can be done by setting nodesep and offset. Everything refers to the center of the node Inicio which is the center of the frame:

[ ... ]
\ncline{Conjunto}{EM}
\pccoil[arm=10mm,linewidth=2pt,coilwidth=5mm]{<-}%
  ([nodesep=1cm,offset=-2cm]Inicio)([nodesep=4cm,offset=6cm]Inicio)
[ ... ]

enter image description here

  • It´s all right :-) but What shock me is that nodesep don´t works as with nodes. if you use nodesep=1cm (one is separted, but the other is overwriting the other node.) The solution is easy,.. one nodesep>0 and other <0, but... it seems to be no natural, as you can see dropbox.com/s/uasls5d2kyhdaoq/stack04h.tex – Mika Ike Jun 3 '14 at 9:23
3

enter image description hereWith use of Manuels package pst-ressort (you can get it here: tex-File, the style-File and the documentation)

\documentclass[pstricks,border=10pt]{standalone}

\usepackage{pst-node,pst-ressort,pstricks-add}

\begin{document}

\begin{pspicture}[showgrid=true](-1,-3)(10,3.2)
\pnode(1,-2){A}
\pnode(8,2){B}

\ncline[linecolor=orange,offset=1.5]{->}{A}{B}
\ncput*[framesep=0pt,nrot=:U]{%
\begin{pspicture}(-2,-0.1)(1.88,0.1)
\psRessort[linecolor=magenta,N=15,li=1,R=0.4,alpha=20,dl=0]{-}(-2,0)(2,0)%
\end{pspicture}
}

\pcline[linecolor=red]{->}(A)(B)
\ncput*[framesep=0pt,nrot=:U]{%
\begin{pspicture}(-1,-0.1)(0.88,0.1)
\psRessort[linecolor=cyan,N=3,li=1,R=0.5,alpha=-25,dl=0]{-}(-1,0)(1,0)%
\end{pspicture}
}

\ncline[linecolor=blue,offset=-1.5]{->}{A}{B}
\ncput*[framesep=0pt,nrot=:U]{%
\begin{pspicture}(-3,-0.1)(2.88,0.1)
\psRessort[linecolor=green,N=25,li=1,R=0.25,alpha=-15,dl=0]{-}(-3,0)(3,0)%
\end{pspicture}
}

\end{pspicture}
\end{document}

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.