[pstricks] Fwd: Label separation using \pstree

Denis Girou Denis.Girou at idris.fr
Wed Jul 4 18:55:46 CEST 2001


>>>>> "John.Culleton" == John Culleton <john at wexfordpress.net> writes:

    John.Culleton> I have a pstree applicaiton where the labels assigned to various edges are
    John.Culleton> too far from the edges. I tried setting labelsep =0pt but they are still to
    John.Culleton> far away. I must be setting the wrong parameter.

    John.Culleton> Here is a code snippet:

    John.Culleton> \psset{linewidth= 1.5pt, levelsep=3cm,treesep=1.0cm,
    John.Culleton> radius=.01pt,labelsep=0pt}
    John.Culleton> \pstree[treemode=R]%
    John.Culleton> {\TC}{%
    John.Culleton> \pstree{\TC}{%
    John.Culleton>    \pstree{\TC}
    John.Culleton>        {\TC \TC}
    John.Culleton>    \pstree{\TC}
    John.Culleton>        {\TC \TC}}%
    John.Culleton> \pstree{\TC}{%
    John.Culleton>        \nbput{Seller proposes}
    John.Culleton>        \naput{$1-\beta$}
    John.Culleton>    \pstree{\TC}{%
    John.Culleton>    \taput{Barter}
    John.Culleton>    \tbput{$\psi_0$}
    John.Culleton>        \TC \TC}
    John.Culleton>    \pstree{\TC}{%
    John.Culleton>         \taput{$1-\psi_0$}
    John.Culleton>         \tbput{Cash}
    John.Culleton>        \TR{$\ (\Delta_1,\Delta_0)$}\naput{Accept} \TR{$\
    John.Culleton> (0,0)$}\nbput{Reject}}}%
    John.Culleton> }

  You can use a negative value for "labelsep". It could give the result that
you would like to have, but personally I do not found it aesthetic (matter of
taste). I found that using a small positive value for "labelsep" with labels
parallel to the edges (it require to use the \n.put macros) look better.
Make your own choice...

\input pst-tree.tex

\psset{linewidth= 1.5pt,levelsep=3cm,treesep=1.0cm,radius=.01pt}

\pstree[treemode=R]%
{\TC}{%
\pstree{\TC}{%
   \pstree{\TC}
       {\TC \TC}
   \pstree{\TC}
       {\TC \TC}}%
\pstree{\TC}{%
       \nbput{Seller proposes}
       \naput{$1-\beta$}
   \pstree{\TC}{%
   \taput{Barter}
   \tbput{$\psi_0$}
       \TC \TC}
   \pstree{\TC}{%
        \taput{$1-\psi_0$}
        \tbput{Cash}
       \TR{$\ (\Delta_1,\Delta_0)$}\naput{Accept} \TR{$\
(0,0)$}\nbput{Reject}}}%
}

\psset{labelsep=0pt}

\pstree[treemode=R]%
{\TC}{%
\pstree{\TC}{%
   \pstree{\TC}
       {\TC \TC}
   \pstree{\TC}
       {\TC \TC}}%
\pstree{\TC}{%
       \nbput{Seller proposes}
       \naput{$1-\beta$}
   \pstree{\TC}{%
   \taput{Barter}
   \tbput{$\psi_0$}
       \TC \TC}
   \pstree{\TC}{%
        \taput{$1-\psi_0$}
        \tbput{Cash}
       \TR{$\ (\Delta_1,\Delta_0)$}\naput{Accept} \TR{$\
(0,0)$}\nbput{Reject}}}%
}

\psset{labelsep=-2pt}

\pstree[treemode=R]%
{\TC}{%
\pstree{\TC}{%
   \pstree{\TC}
       {\TC \TC}
   \pstree{\TC}
       {\TC \TC}}%
\pstree{\TC}{%
       \nbput{Seller proposes}
       \naput{$1-\beta$}
   \pstree{\TC}{%
   \taput{Barter}
   \tbput{$\psi_0$}
       \TC \TC}
   \pstree{\TC}{%
        \taput{$1-\psi_0$}
        \tbput{Cash}
       \TR{$\ (\Delta_1,\Delta_0)$}\naput{Accept} \TR{$\
(0,0)$}\nbput{Reject}}}%
}

\psset{labelsep=1pt,nrot=:U}

\pstree[treemode=R]%
{\TC}{%
\pstree{\TC}{%
   \pstree{\TC}
       {\TC \TC}
   \pstree{\TC}
       {\TC \TC}}%
\pstree{\TC}{%
       \nbput{Seller proposes}
       \naput{$1-\beta$}
   \pstree{\TC}{%
   \naput{Barter}
   \nbput{$\psi_0$}
       \TC \TC}
   \pstree{\TC}{%
        \naput{$1-\psi_0$}
        \nbput{Cash}
       \TR{$\ (\Delta_1,\Delta_0)$}\naput{Accept} \TR{$\
(0,0)$}\nbput{Reject}}}%
}

\bye


D.G.



More information about the PSTricks mailing list