graphe 與 tikz 或 pstricks ?

graphe 與 tikz 或 pstricks ?

我還有關於 TikZ 或 Pstricks 的第二個問題。我怎麼才能輸入代碼來獲取這樣的資訊?謝謝

在此輸入影像描述

答案1

您可以使用 TikZ 及其decorations.markings函式庫。請參閱 TikZ3 手冊第 48.5 節,第 592+ 頁,http://ftp.cvut.cz/tex-archive/graphics/pgf/base/doc/pgfmanual.pdf。我在選項的幫助下附上了這種方法的範例postaction

\documentclass[a4paper]{article}
\pagestyle{empty}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[x=1cm, y=1cm, decoration={markings, mark=at position 0.7 with {\arrow[scale=3]{>}}}, m/.style={blue,line width=1pt}]
\node[font=\bfseries] at (0,1.5) {Sexe};
\node[font=\bfseries] at (3,1.5) {Types d'\'etudes};
\node (f) at (0,0) {F};
\node (m) at (0,-1) {M};
\node (l) at (3.75,0.5) {Litt.};
\node (s) at (3.75,-0.5) {SC};
\node (t) at (3.75, -1.5) {Tech.};
\draw[m, postaction={decorate}] (f) to [bend left=20] (l);
\draw[m, postaction={decorate}] (m) to [bend left=20] (s);
\draw[m, postaction={decorate}] (m) to [bend left=-10] (t);
\end{tikzpicture}
\end{document}

姆韋

答案2

運行與xelatex

\documentclass[a4paper]{article}
\pagestyle{empty}
\usepackage{pstricks-add}

\begin{document}

\def\arraystretch{1.7}
\begin{tabular}{@{} c @{\hspace{1.5cm}} c @{}}
\bfseries\itshape Sexe & \bfseries\itshape Types d'\'etudes \\
                       & \rnode{l}{Litt.}                   \\
\rnode{f}{F}                                                \\
                       & \rnode{s}{SC~~}                    \\
\rnode{m}{M}                                                \\
                       & \rnode{t}{Tech.}
\end{tabular}
\psset{ArrowInside=->,ArrowInsidePos=0.7,arrowscale=2,angleB=180}
\nccurve{f}{l}  \nccurve{m}{s}  \nccurve{m}{t}

\end{document}

在此輸入影像描述

答案3

這是一種可能的解決方案,其中myarrow為位置 = 0.7 處的箭頭裝飾定義樣式。可以使用bend left/right=xx,xx=一些選擇角度。

在此輸入影像描述

程式碼

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.markings,arrows,positioning}

\tikzset{myarrow/.style={decoration={markings,
%mark=at position 0.3 with {\arrow{stealth'}},
mark=at position 0.7 with {\arrow{stealth'}}
},postaction={decorate}
}}  
\begin{document}
\begin{tikzpicture}
\node (A) {Sexe};
\node[right =2cm of A] (B) {Types};

\node [below= 1cm of A](A1){F}; 
\node [below= 1.5cm of A1](A2){M};

\node [below= 1cm of B](B1){Litt}; 
\node [below= 1cm of B1](B2){SC};
\node [below= 1cm of B2](B3){Tech}; 

\draw (A1) edge[myarrow,bend left] (B1);

\draw (A2) edge[myarrow,bend left] (B2);
\draw (A2) edge[myarrow,bend right] (B3);
\end{tikzpicture}

\end{document}

答案4

該解決方案的變體pstricks,使用該 makecell包,為右列產生不同的對齊方式:

        \documentclass[a4paper]{article}
        \usepackage[utf8]{inputenc}
        \usepackage[T1]{fontenc}
        \usepackage{MinionPro}
        \pagestyle{empty}
        \usepackage{makecell}
        \renewcommand*\theadfont{\bfseries\itshape}
        \usepackage[pdf]{pstricks}%
        \usepackage{pstricks-add}

        \begin{document}

        \begin{tabular}{c@{\hskip2.5cm}c}
         \thead{Sexe} & \thead{Types d'études} \\%
                        \makecell{\rnode{F}{F}\\[12pt] \rnode{M}{M}} & \makecell*{\makecell[l]{\rnode{L}{Litt.}\\[15pt] \rnode{S}{SC}\\[15pt] \rnode{T}{Tech.}}} \\
        \end{tabular}

        \psset{ArrowInside = ->, ArrowInsidePos = 0.6,linewidth = 1.5pt, linecolor = blue}
        \ncarc[nodesep = 6pt ]{F}{L}
        \nodexn{(M) + (9pt,0)}{M}
        \ncarc[nodesepA = 0pt, nodesepB = 6pt]{M}{S}
        \ncarc[ArrowInside = -<, ArrowInsidePos = 0.4,nodesepA = 6pt, nodesepB = 0pt ]{T}{M}

        \end{document} 

在此輸入影像描述

相關內容