Manim is not correctly drawing tikzpictures
- 主要语言
- Python
- 星标
- 93.8k
- 派生
- 7.7k
- PR 合并指标
- PR 指标待抓取
描述
I'm very very new to coding and am mostly trying to learn on my own. I'm starting to pick up the basics of manim, but am still having difficulties with troubleshooting. I've been trying to get manim to draw tikz diagrams and I've spent hours digging through what seemed like similar issues. I finally got it to draw the diagram, but it's all messed up and I can't find any solutions online.
I'm trying to do a tree diagram. It should look like this (from LaTeX):

Here's the code I used in manim:
```
from manimlib.imports import *
class TikzMobject(TextMobject):
CONFIG = {
"stroke_width": 3,
"fill_opacity": 0,
"stroke_opacity": 1,
}
class Tree(Scene):
def construct(self):
TreeDiagram = TikzMobject(r"""
\begin{tikzpicture}[level distance=5em,level 1/.style={sibling distance=5cm},level 2/.style={sibling distance=2.5cm},level 3/.style={sibling distance=1cm},every node/.style={shape=rectangle,rounded corners,draw,align=center}]]
\node {Start}
child { node {$s_1$}
child { node {$p_1$}
child { node{$f_1$}}
child { node{$f_2$}}}
child { node {$p_2$}
child { node{$f_1$}}
child { node{$f_2$}}}}
child { node {$s_2$}
child { node {$p_1$}
child { node {$f_1$}}
child { node {$f_2$}}}
child { node {$p_2$}
child { node {$f_1$}}
child { node {$f_2$}}}}
child { node {$s_3$}
child { node {$p_1$}
child { node {$f_1$}}
child { node {$f_2$}}}
child { node {$p_2$}
child { node {$f_1$}}
child { node {$f_2$}}}};
\end{tikzpicture}
""")
TreeDiagram.scale(0.3)
TreeDiagram.rotate(TAU/2)
self.play(FadeIn(TreeDiagram))
```
But what it produces is this:

I would greatly appreciate any help!
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。