绘制该图表的最佳方法是什么?
查看 MWE:
\documentclass[border=2cm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[x=2.5cm]
\draw[black,->,thick,>=latex]
(0,0) -- ++(5.5,0) node[above right] {$t$};
\draw[black,thick]
(0,0) -- ++(0,5pt) node[above] {4000\,BC};
\draw[black,thick]
(1,0) -- ++(0,5pt) node[above] {1800};
\draw[black,thick]
(2,0) -- ++(0,5pt) node[above] {1960};
\draw[black,thick]
(3,0) -- ++(0,5pt) node[above] {1980};
\draw[black,thick]
(4,0) -- ++(0,5pt) node[above] {2000};
%
\node[above right] at (-0.05,-0.8cm) {Manual Processing -- paper and pancil};
\node[above right] at (0.9,-1.3cm) {Mechanical -- punched card};
\node[above right] at (1.8,-1.8cm) {Stored Program -- sequential record processing};
\node[above right] at (2.5,-2.3cm) {Online -- navigational set processing};
\node[above right] at (3.1,-2.8cm) {Non-Procedural -- relational};
\node[above right] at (3.6,-3.3cm) {Multi-Media -- internetwork};
\end{tikzpicture}
\end{document}
答案1
我不确定你想如何精确地跟随图像。(例如,你添加了箭头和刻度标记,吨这些不在您发布的图片中......)
这算是一种妥协。它保留了一些紧密间距的方面(线条非常靠近节点中字母的顶部),但保留了抽动和箭头时间线吨因为我认为如果您不想要它们,您就不会添加它们。
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{backgrounds,positioning}
\begin{document}
\begin{tikzpicture}
[
x=2cm,
epoch line/.append style={draw, ultra thick, black},
font=\bfseries,
year/.append style={font=\sffamily\bfseries},
]
\draw[black,->,thick,>=latex]
(0,0) -- ++(5.5,0) node[above right] {$t$};
\draw[black,thick]
(0,0) -- ++(0,5pt) node (4000bce) [above, year] {4000\,BCE};
\draw[black,thick]
(1,0) -- ++(0,5pt) node (1800) [above, year] {1800};
\draw[black,thick]
(2,0) -- ++(0,5pt) node (1960) [above, year] {1960};
\draw[black,thick]
(3,0) -- ++(0,5pt) node (1980) [above, year] {1980};
\draw[black,thick]
(4,0) -- ++(0,5pt) node (2000) [above, year] {2000};
%
\node (pap) [above right] at (-0.05,-0.8cm) {Manual Processing -- paper and pencil};
\node (pc) [above right, inner xsep=.1em] at (0.9,-1.3cm) {Mechanical -- punched card};
\node (srp) [above right, inner xsep=.1em] at (1.8,-1.8cm) {Stored Program -- sequential record processing};
\node (nsp) [above right, inner xsep=.1em] at (2.5,-2.3cm) {Online -- navigational set processing};
\node (reln) [above right, inner xsep=.1em] at (3.1,-2.8cm) {Non-Procedural -- relational};
\node (inet) [above right, inner xsep=.1em] at (3.6,-3.3cm) {Multi-Media -- internetwork};
\path [epoch line] (pap.north -| 4000bce) -- (5,0 |- pap.north);
\path [epoch line] (pap.south -| 4000bce) -- (5,0 |- pap.south);
\path [epoch line] (pc.south west) -- (5,0 |- pc.south);
\path [epoch line] (srp.south west) -- (5,0 |- srp.south);
\path [epoch line] (nsp.south west) -- (5,0 |- nsp.south);
\path [epoch line] (reln.south west) -- (5,0 |- reln.south);
\path [epoch line] (inet.south west) -- (5,0 |- inet.south);
\path [epoch line] (pc.south west |- pap.south) -- (pc.south west);
\path [epoch line] (srp.south west |- pc.south) -- (srp.south west);
\path [epoch line] (nsp.south west |- srp.south) -- (nsp.south west);
\path [epoch line] (reln.south west |- nsp.south) -- (reln.south west);
\path [epoch line] (inet.south west |- reln.south) -- (inet.south west);
\begin{scope}[on background layer]
\fill [left color=red!60!white, right color=white] (inet.north west) -- (5,0 |- inet.north) -- (5,0 |- inet.south) -- (inet.south west) -- cycle;
\fill [left color=orange!60!white, right color=white] (reln.north west) -- (5,0 |- reln.north) -- (5,0 |- reln.south) -- (reln.south west) -- cycle;
\fill [left color=magenta!60!white, right color=white] (nsp.north west) -- (5,0 |- nsp.north) -- (5,0 |- nsp.south) -- (nsp.south west) -- cycle;
\fill [left color=blue!60!white, right color=white] (srp.north west) -- (5,0 |- srp.north) -- (5,0 |- srp.south) -- (srp.south west) -- cycle;
\fill [left color=blue!60!green!60!white, right color=white] (pc.north west) -- (1980 |- pc.north) -- (1980 |- pc.south) -- (pc.south west) -- cycle;
\fill [fill=white] (1980 |- pc.north) -- (5,0 |- pc.north) -- (5,0 |- pc.south) -- (1980 |- pc.south) -- cycle;
\fill [left color=white, right color=green!70!blue!60!white] (pap.north -| 4000bce) -- (5,0 |- pap.north) -- (5,0 |- pap.south) -- (pap.south -| 4000bce) -- cycle;
\end{scope}
\end{tikzpicture}
\end{document}
毫无疑问还有更好的方法……