怎么绘制更合适的曲线

2020-11-25 15:27发布

## 编译环境 操作系统 Windows 10 Tex发行版 TexLive `2020` ## 我的问题 我正在绘制图论里的图,涉及到一些曲线的绘制。 ``` \documentclass...

## 编译环境 操作系统 Windows 10 Tex发行版 TexLive `2020` ## 我的问题 我正在绘制图论里的图,涉及到一些曲线的绘制。 ``` \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{shapes.geometric, arrows} \tikzstyle{operator}=[circle, radius= 0.5 cm, text centered, draw=black] \tikzstyle{operator2}=[circle,fill=black, radius= 0.0 cm] \tikzstyle{arrow}= [thick, -, >=stealth] \begin{document} \begin{tikzpicture} \node(A0)[operator] {$A_0$}; \node(A1)[operator, below of = A0] {$A_1$}; \node(A2)[operator, below of = A1] {$A_2$}; \node(B0)[operator, right of = A0, xshift=2cm] {$B_0$}; \node(B1)[operator, below of = B0] {$B_1$}; \node(B2)[operator, below of = B1] {$B_2$}; \node(C0)[operator, right of = B0, xshift=2cm] {$C_0$}; \node(C1)[operator, below of = C0] {$C_1$}; \node(C2)[operator, below of = C1] {$C_2$}; \draw (A0) edge[out=0, in=180, arrow] node[pos=0.85, above]{} (B1); \draw (A1) edge[out=0, in=180, arrow] node[pos=0.85, above]{} (B2); \draw (A2) edge[out=0, in=180, arrow] node[pos=0.85, above]{} (B0); \draw (B0) edge[out=0, in=180, arrow] (C2); \draw (B1) edge[out=0, in=180, arrow] node[pos=0.1, above]{12} (C0); \draw (B2) edge[out=0, in=180, arrow] node[pos=0.85, above]{} (C1); \draw (C0) edge[out=-50, in=-20, arrow, out looseness=2.6, in looseness=1.5] node[pos=0.85, below]{} (A2); \draw (C1) edge[out=40, in=20, arrow, out looseness=1.5] node[pos=0.85, above]{} (A0); \draw (C2) edge[out=-40, in=-40, arrow, in looseness=1.6] node[pos=0.85, below]{} (A1); \draw (C1) edge[out=10, in=120, arrow, out looseness=1.5] node[pos=0.85, above]{} (A1); \end{tikzpicture} \end{document} ``` 得到下面的图 ![](https://wenda.latexstudio.net/data/attach/201125/6aedpBFf.png) 我做了C1A1曲线角度的很多调整,都得不到下面的效果。 ![](https://wenda.latexstudio.net/data/attach/201125/lScYirVE.png) 于是我添加一个辅助点D0,让我的曲线更容易绘制,可是又涉及到一个问题,就是辅助点不能很好的缩小,即使设置 radius= 0.0 cm 我不希望显示辅助点 ``` \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{shapes.geometric, arrows} \tikzstyle{operator}=[circle, radius= 0.5 cm, text centered, draw=black] \tikzstyle{operator2}=[circle,fill=black, radius= 0.0 cm] \tikzstyle{arrow}= [thick, -, >=stealth] \begin{document} \begin{tikzpicture} \node(A0)[operator] {$A_0$}; \node(A1)[operator, below of = A0] {$A_1$}; \node(A2)[operator, below of = A1] {$A_2$}; \node(B0)[operator, right of = A0, xshift=2cm] {$B_0$}; \node(B1)[operator, below of = B0] {$B_1$}; \node(B2)[operator, below of = B1] {$B_2$}; \node(C0)[operator, right of = B0, xshift=2cm] {$C_0$}; \node(C1)[operator, below of = C0] {$C_1$}; \node(C2)[operator, below of = C1] {$C_2$}; \node(D0)[operator2, above of = B0,xshift=1.5cm,yshift=1cm]{}; %辅助点 \draw (A0) edge[out=0, in=180, arrow] node[pos=0.85, above]{} (B1); \draw (A1) edge[out=0, in=180, arrow] node[pos=0.85, above]{} (B2); \draw (A2) edge[out=0, in=180, arrow] node[pos=0.85, above]{} (B0); \draw (B0) edge[out=0, in=180, arrow] (C2); \draw (B1) edge[out=0, in=180, arrow] node[pos=0.1, above]{12} (C0); \draw (B2) edge[out=0, in=180, arrow] node[pos=0.85, above]{} (C1); \draw (C0) edge[out=-50, in=-20, arrow, out looseness=2.6, in looseness=1.5] node[pos=0.85, below]{} (A2); \draw (C1) edge[out=40, in=20, arrow, out looseness=1.5] node[pos=0.85, above]{} (A0); \draw (C2) edge[out=-40, in=-40, arrow, in looseness=1.6] node[pos=0.85, below]{} (A1); %C1到A0借助辅助点D0 \draw (C1) edge[out=10, in=20, arrow, out looseness=1.5] node[pos=0.85, above]{} (D0);% \draw (D0) edge[out=170, in=130, arrow, out looseness=1.5] node[pos=0.85, above]{} (A1); \end{tikzpicture} \end{document} ``` ![](https://wenda.latexstudio.net/data/attach/201125/D0xaIrOF.png) 我应该怎么得到我想要的 C1A1曲线。谢谢大家!
2条回答
zhaochongbin
2020-11-25 18:31 .采纳回答
但凡带点不规则曲线的,没有图形化工具直接用 tikz 敲都很难受的啊 ```tex \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{shapes.geometric, arrows} \tikzstyle{operator}=[circle, radius= 0.5 cm, text centered, draw=black] \tikzstyle{operator2}=[circle,fill=black, radius= 0.0 cm] \tikzstyle{arrow}= [thick, -, >=stealth] \begin{document} \begin{tikzpicture} \node(A0)[operator] {$A_0$}; \node(A1)[operator, below of = A0] {$A_1$}; \node(A2)[operator, below of = A1] {$A_2$}; \node(B0)[operator, right of = A0, xshift=2cm] {$B_0$}; \node(B1)[operator, below of = B0] {$B_1$}; \node(B2)[operator, below of = B1] {$B_2$}; \node(C0)[operator, right of = B0, xshift=2cm] {$C_0$}; \node(C1)[operator, below of = C0] {$C_1$}; \node(C2)[operator, below of = C1] {$C_2$}; \draw (A0) edge[out=0, in=180, arrow] node[pos=0.85, above]{} (B1); \draw (A1) edge[out=0, in=180, arrow] node[pos=0.85, above]{} (B2); \draw (A2) edge[out=0, in=180, arrow] node[pos=0.85, above]{} (B0); \draw (B0) edge[out=0, in=180, arrow] (C2); \draw (B1) edge[out=0, in=180, arrow] node[pos=0.1, above]{12} (C0); \draw (B2) edge[out=0, in=180, arrow] node[pos=0.85, above]{} (C1); \draw (C0) edge[out=-50, in=-20, arrow, out looseness=2.6, in looseness=1.5] node[pos=0.85, below]{} (A2); \draw (C1) edge[out=40, in=20, arrow, out looseness=1.5] node[pos=0.85, above]{} (A0); \draw (C2) edge[out=-40, in=-40, arrow, in looseness=1.6] node[pos=0.85, below]{} (A1); \draw[arrow] plot[smooth, tension=.7] coordinates {(A1.west) (-0.9614,0.5872) (3.0698,1.3528) (7.0596,1.0583) (7.9136,-0.1342) (C1.east)}; \end{tikzpicture} \end{document} ``` ![](https://wenda.latexstudio.net/data/attach/201125/BQy1Y8yq.png)

作者追问:2020-11-25 18:31

十分感谢的您帮助! tikz学习成本挺高的,不过我准备选择它的原因是清晰的向量图格式。

一周热门 更多>