如何在图表中画一条粗线?

如何在图表中画一条粗线?

我有这段代码可以生成图表。如何让 1-3 号线变粗?在此处输入图片描述

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[top=2in, bottom=1in, left=1in, right=1in]{geometry}
\usepackage{circuitikz}
\usepackage{tkz-graph}

\begin{document}

\begin{tikzpicture}
\GraphInit[vstyle=Normal]
%   \tikzset{EdgeStyle/.style={post}}

% Vertices
\Vertex[x=0, y=0] {4}
\Vertex[x=4, y=4] {2}
\Vertex[x=0, y=4] {1}
\Vertex[x=2, y=2] {3}
% Edges 


\Edge(2)(1)
\Edge(1)(4)
\Edge(4)(3)
\Edge(1)(3)
\Edge(3)(2)

\end{tikzpicture}



\bibliographystyle{plain}

\end{document}

答案1

方法 a:可以局部重新定义边的样式:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[top=2in, bottom=1in, left=1in, right=1in]{geometry}
\usepackage{tkz-graph}

\begin{document}
\begin{tikzpicture}
\GraphInit[vstyle=Normal]
  % Vertices
  \Vertex[x=0, y=0] {4}
  \Vertex[x=4, y=4] {2}
  \Vertex[x=0, y=4] {1}
  \Vertex[x=2, y=2] {3}

  % Edges
  \Edge(2)(1)
  \Edge(1)(4)
  \Edge(4)(3)
  \begin{scope}[EdgeStyle/.append style=ultra thick]
    \Edge(1)(3)
  \end{scope}
  \Edge(3)(2)
\end{tikzpicture}
\end{document}

结果

\draw或者可以使用以下附加设置来绘制线条EdgeStyle

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[top=2in, bottom=1in, left=1in, right=1in]{geometry}
\usepackage{tkz-graph}

\begin{document}
\begin{tikzpicture}
\GraphInit[vstyle=Normal]
  % Vertices
  \Vertex[x=0, y=0] {4}
  \Vertex[x=4, y=4] {2}
  \Vertex[x=0, y=4] {1}
  \Vertex[x=2, y=2] {3}

  % Edges
  \Edge(2)(1)
  \Edge(1)(4)
  \Edge(4)(3)
  \draw[EdgeStyle, ultra thick](1) -- (3);
  \Edge(3)(2)
\end{tikzpicture}
\end{document}

相关内容