关于简单图表的一个问题

关于简单图表的一个问题

我想制作一个简单的图表,并将其附加到附件中。有人能帮助我吗?在此处输入图片描述

答案1

一个简单的解决方案pstricks

\documentclass[11pt,  border=5pt]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}%
\usepackage{lmodern, amssymb}
\usepackage{mathtools}
\usepackage{pst-node}
\usepackage{auto-pst-pdf} 

\begin{document}

\psset{arrows=->, linewidth=0.6pt, arrowinset=0.12}
\everypsbox{\scriptsize}
 \begin{psmatrix}[colsep=0.4]
& [name=MainPb] \clap{\fbox{Main Problem}}\\
& [name=MathPb] \clap{\fbox{Mathematical Problem}}\\
[name = ESol] Exact Solution &  &  [name = ASol] Approximate Solution %
\ncline[nodesep=0.1pt]{MainPb}{MathPb}\naput{modelling}%
\ncline[nodesepA=1.15ex]{MathPb}{ESol}\tlput{Analytical method}%
\ncline[nodesepA=1.6ex]{MathPb}{ASol}\trput{Numerical method}%
\end{psmatrix} 

\end{document} 

在此处输入图片描述

答案2

我建议使用tikz。对于您的简单图表,基本的 LaTeX 命令就足够了,但如果您要求更多,它将无法扩展。因此,请查看任何有关 TikZ 的教程或介绍,例如TikZ 的简单介绍

作为起点,这是您的图表tikzpicture

\documentclass[border=1mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
  \node[draw]                (main)    {main problem};
  \node[below=of main,draw]  (math)    {mathematical problem};
  \node[below left=of math]  (exact)   {exact solution};
  \node[below right=of math] (approx)  {approximate solution};
  \draw[->] (main) -- node[left]       {modeling}          (math);
  \draw[->] (math) -- node[above left] {analytical method} (exact);
  \draw[->] (math) -- node[above right]{numerical method}  (approx);
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案3

它是一棵树。因此,我会使用森林。

首先是基本版本:

\begin{forest}
  where n children=0{}{draw},
  for tree={edge+={->}, font=\sffamily, l sep'+=30pt},
  label me/.style={
    edge label/.process={On=?_w}{n}{1}{left, anchor=mid east}{right, anchor=mid west}{node [midway, ##1, font=\sffamily] {#1}},
  },
  [Main Problem
    [Mathematical Problem, label me=Modelling
      [Exact Solution, label me=Analytical Method]
      [Approximate Solution, label me=Numerical Method]
    ]
  ]
\end{forest}

基本的

Nest,更精致的版本:

\begin{forest}
  where n children=0{}{draw=darkgray, blur shadow, top color=white, bottom color=gray!10},
  for tree={edge+={-Latex, darkgray}, font=\sffamily, text=darkgray, l sep'+=30pt, rounded corners},
  label me/.style={
    edge label/.process={On=?_w}{n}{1}{left, anchor=mid east}{right, anchor=mid west}{node [midway, ##1, font=\sffamily, text=gray] {#1}},
  },
  [Main Problem
    [Mathematical Problem, label me=Modelling
      [Exact Solution, label me=Analytical Method]
      [Approximate Solution, label me=Numerical Method]
    ]
  ]
\end{forest}

爱好者

完整代码:

\documentclass[border=10pt,multi,tikz]{standalone}
\usepackage{forest}
\usetikzlibrary{arrows.meta,shadows.blur}
\begin{document}
\begin{forest}
  where n children=0{}{draw},
  for tree={edge+={->}, font=\sffamily, l sep'+=30pt},
  label me/.style={
    edge label/.process={On=?_w}{n}{1}{left, anchor=mid east}{right, anchor=mid west}{node [midway, ##1, font=\sffamily] {#1}},
  },
  [Main Problem
    [Mathematical Problem, label me=Modelling
      [Exact Solution, label me=Analytical Method]
      [Approximate Solution, label me=Numerical Method]
    ]
  ]
\end{forest}
\begin{forest}
  where n children=0{}{draw=darkgray, blur shadow, top color=white, bottom color=gray!10},
  for tree={edge+={-Latex, darkgray}, font=\sffamily, text=darkgray, l sep'+=30pt, rounded corners},
  label me/.style={
    edge label/.process={On=?_w}{n}{1}{left, anchor=mid east}{right, anchor=mid west}{node [midway, ##1, font=\sffamily, text=gray] {#1}},
  },
  [Main Problem
    [Mathematical Problem, label me=Modelling
      [Exact Solution, label me=Analytical Method]
      [Approximate Solution, label me=Numerical Method]
    ]
  ]
\end{forest}
\end{document}

相关内容