![如何为演示文稿生成漂亮的三点(或 n 点)图形](https://linux22.com/image/466463/%E5%A6%82%E4%BD%95%E4%B8%BA%E6%BC%94%E7%A4%BA%E6%96%87%E7%A8%BF%E7%94%9F%E6%88%90%E6%BC%82%E4%BA%AE%E7%9A%84%E4%B8%89%E7%82%B9%EF%BC%88%E6%88%96%20n%20%E7%82%B9%EF%BC%89%E5%9B%BE%E5%BD%A2.png)
在 PowerPoint 中,通常有三个关键点图,例如
(来源:https://www.slideteam.net/performance-mapping-ppt-powerpoint-presentation-portfolio-graphics-pictures-cpb.html)
或者
(来源:https://www.slidegeeks.com/business/product/three-levels-relationship-marketing-examples-ppt-powerpoint-presentation-ideas-display)
我的问题是,如何在 LaTeX 中最好地生成此类图表以供 beamer 使用?
我猜想这可能涉及 TikZ?理想情况下,可以提供一些指导,如果可能的话,甚至可以提供 MWE 来创建类似的漂亮图表。这样,LaTeX 用户也可以使用此类样式。
- 左侧有一个中心节点,如第一个示例所示
- 三个(或者更好,数量灵活)子节点围绕中心节点(在其右侧)排列
- 子节点旁边的文本条目(如第二个示例所示)
- 颜色样式与第二个示例类似
答案1
完成(感谢评论中对类似问题的引用)。
这是一个相当基本的例子,可能可以调整以适应更广泛的应用程序。不过,就目前而言,这是一个很好的开始。
\documentclass{beamer}
\usetheme{metropolis}
\usepackage{adjustbox}
\usepackage{tikz}
\usetikzlibrary{positioning,arrows.meta}
% Base color for diagrams
\definecolor{diagrambasecolor}{HTML}{65a0b0}
\begin{document}
\begin{frame}{Demo}
\begin{adjustbox}{max width=\textwidth}
\begin{tikzpicture}[
bigcircle/.style={ % style for the circles
node distance=22pt,
text width=1.6cm, % diameter
align=center, % center align
line width=1.5mm, % thickness of border
draw, % draw the border
circle, % shape
font=\bfseries\large % font type and size
},
description/.style={
node distance=40pt
}
]
\node [bigcircle,text width=2cm,draw=black!10] (center) {Center};
\node [bigcircle,draw=diagrambasecolor,above right=of center] (subcircle1) {1};
\node [description,right=of subcircle1] (description1) {First item};
\node [bigcircle,draw=diagrambasecolor!85!black,right=of center] (subcircle2) {2};
\node [description,right=of subcircle2] (description2) {Second item};
\node [bigcircle,draw=diagrambasecolor!70!black,below right=of center] (subcircle3) {3};
\node [description,right=of subcircle3] (description3) {Third item};
% Draw lines towards the item descriptions
\draw [-Circle,black!20,shorten <=2pt]
(subcircle1) edge (description1)
(subcircle2) edge (description2)
(subcircle3) edge (description3);
\end{tikzpicture}
\end{adjustbox}
\end{frame}
\end{document}