Manim

テーブルに非アスキー文字や数式を混在させる

Manim CEでテーブルを作る際に、非アスキー文字や数式を混在させるには、MobjectTableを使用して、以下のように記述します。

Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 
 
 
 
 
 
 
 
 
 
 
 
 
        t = MobjectTable(
            [[Text('空気密度:', font='Meiryo'), MathTex(r'\rho_{air}=1.2\;[kg/m^3]', font_size=48)],
             [Text('空気粘度:', font='Meiryo'), MathTex(r'\mu_{air}=1.8\times 10^{-2}\;[Pa\cdot s]', font_size=48)],
             [Text('水銀密度:', font='Meiryo'), MathTex(r'\rho_{mercury}=13600\;[kg/m^3]', font_size=48)],
             [Text('水銀粘度:', font='Meiryo'), MathTex(r'\mu_{mercury}=1.5\;[Pa\cdot s]', font_size=48)],
             [Text('水銀-空気間の表面張力:', font='Meiryo'), MathTex(r'\sigma = 0.48\;[N/m]', font_size=48)],
             [Text('接触角:', font='Meiryo'), MathTex(r'\phi = 140\;[deg]', font_size=48)],
            ],
            arrange_in_grid_config={"cell_alignment": LEFT},
            line_config={"stroke_width": 1, "color": GREEN_B}
        ).scale(0.6).next_to(prop_desc, DOWN, buff=0.5)
        t.remove(*t.get_vertical_lines())

このようにすると、以下のように、非アスキー文字や数式が混在したテーブルを作成できます。

 mobject_table

添付ファイル: filemobject_table.png 50件 [詳細]

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2024-11-20 (水) 18:29:44 (90d)