![我如何绘制规范的 IV DAG?](https://linux22.com/image/445344/%E6%88%91%E5%A6%82%E4%BD%95%E7%BB%98%E5%88%B6%E8%A7%84%E8%8C%83%E7%9A%84%20IV%20DAG%EF%BC%9F.png)
这是我的代码:
\documentclass{scrartcl}
\usepackage{tkz-graph}
\usetikzlibrary{shapes.geometric}%
\thispagestyle{empty}
\begin{document}
\tikzstyle{VertexStyle} = [shape = ellipse,
minimum width = 6ex,%
draw]
\tikzstyle{EdgeStyle} = [->,>=stealth']
\begin{tikzpicture}[scale=1.5]
\SetGraphUnit{2}
\Vertex{Z} \EA(Z){A}
\SOEA(A){U} \NOEA(U){Y}
\Edges(Z,A,Y) \Edges(U,A) \Edges(U,Y)
\end{tikzpicture}
\end{document}
如何制作从 U 到 A 和从 U 到 Y 的虚线箭头?
答案1
欢迎使用 TeX: SE。您可以通过以下方式更改边缘样式\Edges[style=dashed] (<vertex-1>,<vertext-2>);
:
%\documentclass{scrartcl}
\documentclass[border=3.141592]{standalone} % accomodate page size to image size
\usepackage{tkz-graph}
\usetikzlibrary{arrows.meta,
shapes.geometric}%
\tikzstyle{VertexStyle} = [shape=ellipse,
minimum width=6ex,
draw]
\tikzstyle{EdgeStyle} = [-Stealth]
\thispagestyle{empty}
\begin{document}
\begin{tikzpicture}[scale=1.5]
\SetGraphUnit{2}
\Vertex{Z} \EA(Z){A}
\SOEA(A){U} \NOEA(U){Y}
\Edges(Z,A,Y)
\Edges[style=dashed](U,A)
\Edges[style=dashed](U,Y)
\end{tikzpicture}
\end{document}