我想创建一个节点样式,它由一个圆圈和两条线(可能向内弯曲)组成,south west
并与和south east
连接。north west
north east
经过一番研究,我找到了一种原则上应该是解决方案的方法:
\tikzset{
Vh/.style = {draw, circle, minimum size=1cm, ultra thick, text = black, path picture={%
\draw (path picture bounding box.south east) -- (path picture bounding box.north west)
(path picture bounding box.north east) -- (path picture bounding box.south west)
(path picture bounding box.north east) -- (path picture bounding box.north west)
;}}
但是,出于某种原因,这只会产生对角线。此解决方案既不能产生垂直线也不能产生水平线。但为什么呢?是 bug 还是我做错了?有没有更好的解决方案?
答案1
你是这个意思?
\documentclass[a4paper,11pt]{article}
\usepackage{tikz}
\tikzset{
Vh/.style = {draw, circle, minimum size=1cm, ultra thick, text = black, path picture={%
\draw (path picture bounding box.south east) to[bend right] (path picture bounding box.south west)
(path picture bounding box.north east) to[bend left] (path picture bounding box.north west)
;}}
}
\begin{document}
\begin{tikzpicture}
\node[Vh] {here};
\end{tikzpicture}
\end{document}
改变的行是
\draw (path picture bounding box.south east) to[bend right] (path picture bounding box.south west)
(path picture bounding box.north east) to[bend left] (path picture bounding box.north west)
在哪里to[bend left/right]
已经使用过。