私はManimへの進出を始めたばかりで、正しくインストールされ(コミュニティバージョン)、いくつかのサンプルプログラムを実行しました。私がやりたいことの 1 つは、グラフで使用される線の太さを変更することです。graph.set_stroke(width=1) を使用してプロットされている関数の太さを変更できましたが、軸の太さを変更する方法がわかりません。任意の考えをいただければ幸いです。(PS 私はプロのプログラマーではありません。)
CreateGraph(GraphScene) クラス内で stroke_width=1 を使用してみましたが、エラーにはなりませんでしたが、動作しませんでした。
コードは次のとおりです。
from manim import *
class CreateGraph(GraphScene):
def __init__(self, **kwargs):
GraphScene.__init__(
self,
x_min=-3,
x_max=3,
y_min=-5,
y_max=5,
graph_origin=ORIGIN,
axes_color=BLUE,
stroke_width=1
)
def construct(self):
# Create Graph
self.setup_axes(animate=True)
graph = self.get_graph(lambda x: x**2, WHITE)
graph_label = self.get_graph_label(graph, label='x^{2}')
graph.set_stroke(width=1)
graph2 = self.get_graph(lambda x: x**3, WHITE)
graph_label2 = self.get_graph_label(graph2, label='x^{3}')
# Display graph
self.play(ShowCreation(graph), Write(graph_label))
self.wait(1)
self.play(Transform(graph, graph2), Transform(graph_label, graph_label2))
self.wait(1)