我对使用 Tikz 还不是很熟悉,但我想用它来完成我的论文。过去两天,我一直在这个论坛上寻找调整箭头粗细的方法,但不幸的是,结合我目前的结构,这似乎几乎是不可能的。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.markings}
\usepackage{fullpage}
\tikzstyle{place}=[draw]
\tikzstyle{transition}=[draw]
\tikzstyle{customer}=[draw]
\tikzstyle{depot}=[draw]
\begin{document}
\textbf{Initial Situation}
\newline
\begin{tikzpicture}
[customer/.style={circle,draw=black!100,fill=gray!50, inner sep=0pt,minimum size=2mm},
depot/.style={rectangle,draw=black!100,fill=black!100,thick, inner sep=0pt,minimum size=3mm}]
\node[customer] (1) at (0.1,0.1) {};
\node[customer] (2) at (0.4,2.6) {};
\node[customer] (3) at (0.7,1.2) {};
\node[customer] (4) at (1.1,1.6) {};
\node[customer] (5) at (1.3,0.3) {};
\node[customer] (6) at (1.6,2.7) {};
\node[customer] (7) at (2.2,0.8){};
\node[customer] (8) at (2.4,2.2) {};
\node[customer] (9) at (2.6,0.1) {};
\node[customer] (10) at(2.9,1.2) {};
\node[depot] (D) at (1.7,1.5) {};
% Route 1
\draw [->] (D) -- (8);
\draw [->] (8) -- (6);
\draw [->] (6) -- (2);
\draw [->] (2) -- (4);
\draw [->] (4) -- (D);
% Route 2
\draw [->] (D) -- (10);
\draw [->] (10) -- (7);
\draw [->] (7) -- (5);
\draw [->] (5) -- (3);
\draw [->] (3) -- (D);
\end{tikzpicture}
\end{document}}
有什么简单快捷的注释可以调整箭头的粗细吗?我希望线条更粗,尤其是帽子!
期待一些意见!
答案1
你想要这样的东西吗?
\documentclass[tikz,border=10pt,multi]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
[
customer/.style={circle, draw, fill=gray!50, inner sep=0pt, minimum size=2mm},
depot/.style={draw, fill, thick, inner sep=0pt, minimum size=3mm},
thick,
>={Triangle[width=.75ex, length=1ex]}
]
\node[customer] (1) at (0.1,0.1) {};
\node[customer] (2) at (0.4,2.6) {};
\node[customer] (3) at (0.7,1.2) {};
\node[customer] (4) at (1.1,1.6) {};
\node[customer] (5) at (1.3,0.3) {};
\node[customer] (6) at (1.6,2.7) {};
\node[customer] (7) at (2.2,0.8){};
\node[customer] (8) at (2.4,2.2) {};
\node[customer] (9) at (2.6,0.1) {};
\node[customer] (10) at(2.9,1.2) {};
\node[depot] (D) at (1.7,1.5) {};
% Route 1
\draw [->] (D) -- (8);
\draw [->] (8) -- (6);
\draw [->] (6) -- (2);
\draw [->] (2) -- (4);
\draw [->] (4) -- (D);
% Route 2
\draw [->] (D) -- (10);
\draw [->] (10) -- (7);
\draw [->] (7) -- (5);
\draw [->] (5) -- (3);
\draw [->] (3) -- (D);
\end{tikzpicture}
\end{document}
请注意arrows
, 和 一起已被弃用\tikzstyle
。arrows.meta
和\tikzset
是目前推荐的。