2

I have test that psmatrix is a good way to do diagrams, but ... to do diagrams where the nodes is not displayed as a "perfect matrix/table".

What is the recommended way to do any similar to, with ps pictures in the nodes?, with fully liberty for place where I want the center of the node. enter image description here

Code example with psmatrix:

\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$}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
&[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} 
  • With pst-tree? – Bernard Jun 1 '14 at 12:29
  • @Bernard, no necessarily. In any way. – Mika Ike Jun 1 '14 at 13:26
3

It is also possible to place the frames with \rput. showgrid=true enables the grid for the coordinates and showgrid=false hide it:

\documentclass[12pt,a4paper,x11names]{article}
\usepackage{pst-blur,pstricks-add}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}

\def\myFrameNode#1(#2){\rput(#2){\rnode{#1}{%
  \psframe[framearc=0.2,shadowcolor=black!70,shadowangle=-90,shadow,
           fillstyle=solid,fillcolor=lightgray](-2.5,-2.5)(2.5,2.5)}}}

\begin{document}

\begin{figure}[htb!]
\centering
\resizebox{10cm}{!}{%
\begin{pspicture}[showgrid=true](17,6)
\myFrameNode{Inicio}(3,3)%
\myFrameNode{Conjunto}(9,3)%
\myFrameNode{EM}(15,3)
\psset{linewidth=3pt, linecolor=red, arrows=->, nodesep=2.6cm}%
\ncline{Inicio}{Conjunto}%
\ncline{Conjunto}{EM}%
\end{pspicture}%
}
\caption{Esquema $(1 + \lambda)$}\label{1maslambda-ilustracion}
\end{figure}

\begin{center}
\psscalebox{0.6}{%
\begin{pspicture}[showgrid=false](13,12)
\myFrameNode{Inicio}(3,5)%
\myFrameNode{Conjunto}(10,9)%
\myFrameNode{EM}(10,2.5)%
\psset{linewidth=3pt, linecolor=red, arrows=->, nodesep=2.6cm}%
\ncline{Inicio}{Conjunto}%
\ncline{Conjunto}{EM}%
\ncline{Inicio}{EM}%
\end{pspicture}}
\end{center}

\end{document} 

enter image description here

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.