Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

scale_to_fit_width -> set_width, likewise for height and depth

Grant Sanderson7119f0cc6e28
diff --git a/active_projects/eola2/cramer.py b/active_projects/eola2/cramer.py
index cb198d43d..269f0bfdf 100644
--- a/active_projects/eola2/cramer.py
+++ b/active_projects/eola2/cramer.py
@@ -57,7 +57,7 @@ class LinearSystem(VGroup):
self.output_vect_mob.elements.set_color(OUTPUT_COLOR)
for mob in self.matrix_mobject, self.input_vect_mob, self.output_vect_mob:
- mob.scale_to_fit_height(self.height)
+ mob.set_height(self.height)
self.add(
self.matrix_mobject,
@@ -111,7 +111,7 @@ class LeaveItToComputers(TeacherStudentsScene):
)
rhs = VGroup(numer, Line(LEFT, RIGHT).match_width(numer), denom)
rhs.arrange_submobjects(DOWN)
- rhs.scale_to_fit_height(2.25)
+ rhs.set_height(2.25)
rhs.move_to(self.hold_up_spot, DOWN)
rhs.to_edge(RIGHT, buff=LARGE_BUFF)
equals = TexMobject("=").next_to(rhs, LEFT)
@@ -259,7 +259,7 @@ class NotTheMostComputationallyEfficient(Scene):
words = TextMobject(self.words)
words.set_color(RED)
words.set_stroke(WHITE, 1)
- words.scale_to_fit_width(FRAME_WIDTH - 2 * MED_LARGE_BUFF)
+ words.set_width(FRAME_WIDTH - 2 * MED_LARGE_BUFF)
self.play(Write(words))
self.wait()
@@ -370,7 +370,7 @@ class SetupSimpleSystemOfEquations(LinearTransformationScene):
)
corner_rect.set_stroke(width=0)
corner_rect.set_fill(BLACK, opacity=0.8)
- corner_rect.scale_to_fit_height(2)
+ corner_rect.set_height(2)
corner_rect.to_corner(UL, buff=0)
self.play(system_in_lines.to_edge, UP)
@@ -403,7 +403,7 @@ class SetupSimpleSystemOfEquations(LinearTransformationScene):
Write(self.plane),
FadeOut(system_in_lines),
FadeIn(corner_rect),
- matrix_system.scale_to_fit_height, corner_rect.get_height() - MED_LARGE_BUFF,
+ matrix_system.set_height, corner_rect.get_height() - MED_LARGE_BUFF,
matrix_system.move_to, corner_rect,
)
self.play(*map(GrowArrow, self.basis_vectors))
@@ -1769,10 +1769,10 @@ class TransformingAreasYCoord(LinearTransformationScene):
# Setup rhs
frac_matrix_height = 1.5
matrix_mobject_copy = matrix_mobject.copy()
- matrix_mobject_copy.scale_to_fit_height(frac_matrix_height)
+ matrix_mobject_copy.set_height(frac_matrix_height)
denom_det_text = get_det_text(matrix_mobject_copy)
top_matrix_mobject = IntegerMatrix(new_matrix)
- top_matrix_mobject.scale_to_fit_height(frac_matrix_height)
+ top_matrix_mobject.set_height(frac_matrix_height)
top_matrix_mobject.set_color_columns(X_COLOR, Y_COLOR)
VGroup(*top_matrix_mobject.mob_matrix[:, self.index]).set_color(MAROON_B)
top_matrix_mobject.add_background_rectangle()
@@ -2038,7 +2038,7 @@ class ThreeDCoordinatesAsVolumes(Scene):
class WriteCramersRule(Scene):
def construct(self):
words = TextMobject("``Cramer's Rule''")
- words.scale_to_fit_width(FRAME_WIDTH - LARGE_BUFF)
+ words.set_width(FRAME_WIDTH - LARGE_BUFF)
words.add_background_rectangle()
self.play(Write(words))
self.wait()
@@ -2153,7 +2153,7 @@ class Thumbnail(TransformingAreasYCoord):
self.apply_transposed_matrix([[2, -0.5], [1, 2]])
words = TextMobject("Cramer's", "rule")
- words.scale_to_fit_width(7)
+ words.set_width(7)
# words.add_background_rectangle_to_submobjects()
words.add_background_rectangle()
words.to_edge(UP)
diff --git a/active_projects/eola2/determinant_puzzle.py b/active_projects/eola2/determinant_puzzle.py
index 45429f1b3..06065ce6b 100644
--- a/active_projects/eola2/determinant_puzzle.py
+++ b/active_projects/eola2/determinant_puzzle.py
@@ -60,7 +60,7 @@ class WorkOutNumerically(Scene):
))
equation.arrange_submobjects(RIGHT, buff=SMALL_BUFF)
eq_parts.get_part_by_tex("=").shift(0.2 * SMALL_BUFF * DOWN)
- equation.scale_to_fit_width(FRAME_WIDTH - 2 * LARGE_BUFF)
+ equation.set_width(FRAME_WIDTH - 2 * LARGE_BUFF)
equation.next_to(self.original_equation, DOWN, MED_LARGE_BUFF)
self.play(LaggedStart(FadeIn, equation))
@@ -132,7 +132,7 @@ class WorkOutNumerically(Scene):
TexMobject("-15"),
)
group.arrange_submobjects(DOWN, buff=2 * SMALL_BUFF)
- # group.scale_to_fit_height(0.4*FRAME_HEIGHT)
+ # group.set_height(0.4*FRAME_HEIGHT)
group.next_to(self.equation_with_numbers, DOWN)
group.shift(FRAME_WIDTH * LEFT / 4)
diff --git a/active_projects/eola2/gauss.py b/active_projects/eola2/gauss.py
index c9c00d338..c6fa6bb37 100644
--- a/active_projects/eola2/gauss.py
+++ b/active_projects/eola2/gauss.py
@@ -19,7 +19,7 @@ class FractionMobject(VGroup):
numerator.next_to(line, LEFT, SMALL_BUFF)
denominator.next_to(line, RIGHT, SMALL_BUFF)
self.add(numerator, line, denominator)
- self.scale_to_fit_height(min(self.max_height, self.get_height()))
+ self.set_height(min(self.max_height, self.get_height()))
self.value = fraction
def add_plus_if_needed(self):
@@ -192,7 +192,7 @@ class ShowRowReduction(Scene):
row2.target.next_to(row1.target, DOWN, buff=MED_LARGE_BUFF)
lp, rp = row2_parens = TexMobject("()")
- row2_parens.scale_to_fit_height(row2.get_height() + 2 * SMALL_BUFF)
+ row2_parens.set_height(row2.get_height() + 2 * SMALL_BUFF)
lp.next_to(row2, LEFT, SMALL_BUFF)
rp.next_to(row2, RIGHT, SMALL_BUFF)
scalar = FractionMobject(scale_factor)
diff --git a/active_projects/eop/bayes.py b/active_projects/eop/bayes.py
index 8cad7713e..d0d76b0a2 100644
--- a/active_projects/eop/bayes.py
+++ b/active_projects/eop/bayes.py
@@ -68,7 +68,7 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene):
you.hand.save_state()
you.hand.generate_target()
for card in you.hand.target:
- card.scale_to_fit_height(community_cards.get_height())
+ card.set_height(community_cards.get_height())
selected_community_cards = VGroup(*filter(
lambda card : card.numerical_value >= 10,
@@ -142,7 +142,7 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene):
q_mark = TexMobject("?")
heart_q = VGroup(heart, q_mark)
for mob in heart_q:
- mob.scale_to_fit_height(0.5)
+ mob.set_height(0.5)
heart_q.arrange_submobjects(RIGHT, buff = SMALL_BUFF)
heart_q.move_to(target)
heart_qs.add(heart, q_mark)
@@ -2053,7 +2053,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene):
def play_notes(self, guitar):
note = SVGMobject(file_name = "8th_note")
- note.scale_to_fit_height(0.5)
+ note.set_height(0.5)
note.set_stroke(width = 0)
note.set_fill(BLUE, 1)
note.move_to(guitar)
@@ -2233,7 +2233,7 @@ class Thumbnail(SampleSpaceScene):
label.scale(1.5)
sample_space = self.get_sample_space()
- sample_space.scale_to_fit_height(4.5)
+ sample_space.set_height(4.5)
sample_space.divide_horizontally(0.3)
sample_space[0].divide_vertically(0.8, colors = [GREEN, BLUE])
sample_space[1].divide_vertically(0.3, colors = [GREEN_E, BLUE_E])
diff --git a/active_projects/eop/bayes_footnote.py b/active_projects/eop/bayes_footnote.py
index a842abfa9..c6031e4d2 100644
--- a/active_projects/eop/bayes_footnote.py
+++ b/active_projects/eop/bayes_footnote.py
@@ -157,7 +157,7 @@ class Introduction(TeacherStudentsScene):
bayes = self.bayes_to_intuition[0]
something_else = TextMobject("Something else")
something_else.set_color(YELLOW)
- something_else.scale_to_fit_height(bayes.get_height())
+ something_else.set_height(bayes.get_height())
something_else.move_to(bayes, RIGHT)
new_group = VGroup(
something_else,
@@ -189,7 +189,7 @@ class Introduction(TeacherStudentsScene):
card.shift(i*(0.03*RIGHT + 0.015*DOWN))
deck.next_to(community_cards, LEFT)
cards = VGroup(deck, community_cards)
- cards.scale_to_fit_width(rect.get_width() - 2*SMALL_BUFF)
+ cards.set_width(rect.get_width() - 2*SMALL_BUFF)
cards.next_to(rect.get_bottom(), UP, MED_SMALL_BUFF)
probability = TexMobject(
@@ -212,7 +212,7 @@ class Introduction(TeacherStudentsScene):
guitar.move_to(musician)
guitar.shift(0.31*RIGHT + 0.6*UP)
musician.add(guitar, musician.arms)
- musician.scale_to_fit_height(0.7*rect.get_height())
+ musician.set_height(0.7*rect.get_height())
musician.next_to(rect.get_bottom(), UP, SMALL_BUFF)
probability = TexMobject(
@@ -242,14 +242,14 @@ class OneInOneThousandHaveDisease(Scene):
]).arrange_submobjects(DOWN, SMALL_BUFF)
for x in range(40)
]).arrange_submobjects(RIGHT, SMALL_BUFF)
- all_creatures.scale_to_fit_width(FRAME_WIDTH - 4)
+ all_creatures.set_width(FRAME_WIDTH - 4)
all_creatures.next_to(title, DOWN)
randy = all_creatures[0][0]
all_creatures[0].remove(randy)
randy.change_mode("sick")
randy.set_color(SICKLY_GREEN)
randy.save_state()
- randy.scale_to_fit_height(3)
+ randy.set_height(3)
randy.center()
randy.change_mode("plain")
randy.set_color(BLUE)
@@ -332,7 +332,7 @@ class TestNonDiseaseCase(TestScene):
]).arrange_submobjects(DOWN)
for y in range(10)
]).arrange_submobjects(RIGHT)
- all_creatures.scale_to_fit_height(6)
+ all_creatures.set_height(6)
all_creatures.to_corner(DOWN+LEFT)
last_guy = all_creatures[-1][-1]
rect = SurroundingRectangle(last_guy, buff = 0)
@@ -349,7 +349,7 @@ class TestNonDiseaseCase(TestScene):
)
self.play(ShowCreation(rect))
self.play(
- last_guy.scale_to_fit_height, 2,
+ last_guy.set_height, 2,
last_guy.next_to, all_creatures, RIGHT
)
result = self.get_positive_result(last_guy)
@@ -415,7 +415,7 @@ class RephraseQuestion(Scene):
""",
]))
words.arrange_submobjects(RIGHT, buff = LARGE_BUFF)
- words.scale_to_fit_width(2*(FRAME_X_RADIUS - MED_LARGE_BUFF))
+ words.set_width(2*(FRAME_X_RADIUS - MED_LARGE_BUFF))
prior = TextMobject("Prior")
prior.set_color(GREEN)
@@ -574,7 +574,7 @@ class ShowRestrictedSpace(Scene):
ShowCreation(sick_one_arrow)
)
self.play(
- sick_one.scale_to_fit_height, 2,
+ sick_one.set_height, 2,
sick_one.next_to, sick_one_words, DOWN,
sick_one.to_edge, RIGHT,
)
@@ -663,7 +663,7 @@ class ShowRestrictedSpace(Scene):
)
movers = VGroup(self.sick_one, *self.false_positives)
movers.generate_target()
- movers.target.scale_to_fit_width(1)
+ movers.target.set_width(1)
movers.target.arrange_submobjects(RIGHT)
movers.target.shift(DOWN)
brace = Brace(VGroup(*movers.target[1:]))
@@ -741,7 +741,7 @@ class ShowRestrictedSpace(Scene):
]).arrange_submobjects(DOWN, SMALL_BUFF)
for x in range(self.n_cols)
]).arrange_submobjects(RIGHT, SMALL_BUFF)
- all_creatures.scale_to_fit_height(5)
+ all_creatures.set_height(5)
all_creatures.center().to_edge(LEFT)
healthy_creatures = VGroup(*it.chain(*all_creatures))
@@ -776,7 +776,7 @@ class DepressingForMedicalTestDesigners(TestScene):
cross.replace(checks[-1][-1])
cross.set_color(RED)
Transform(checks[-1][-1], cross).update(1)
- checks.scale_to_fit_height(6)
+ checks.set_height(6)
checks.next_to(title, DOWN)
checks.generate_target()
checks.target.scale(0.5)
@@ -812,7 +812,7 @@ class HowMuchCanYouChangeThisPrior(ShowRestrictedSpace, PiCreatureScene):
def create_pi_creatures(self):
creatures = self.get_all_creatures()
- creatures.scale_to_fit_height(6.5)
+ creatures.set_height(6.5)
creatures.center()
creatures.submobjects = list(it.chain(*creatures))
@@ -876,7 +876,7 @@ class HowMuchCanYouChangeThisPrior(ShowRestrictedSpace, PiCreatureScene):
self.play(FadeOut(to_fade))
self.play(
FadeOut(self.special_rect),
- special_group.scale_to_fit_height, 6,
+ special_group.set_height, 6,
special_group.center,
)
self.wait()
diff --git a/active_projects/eop/chapter0.py b/active_projects/eop/chapter0.py
index 94a9d9df1..2f4719118 100644
--- a/active_projects/eop/chapter0.py
+++ b/active_projects/eop/chapter0.py
@@ -21,7 +21,7 @@ class Introduction(TeacherStudentsScene):
this_video.save_state()
this_video.set_fill(opacity = 0)
this_video.center()
- this_video.scale_to_fit_height(FRAME_HEIGHT)
+ this_video.set_height(FRAME_HEIGHT)
self.this_video = this_video
diff --git a/active_projects/eop/chapter0/intro.py b/active_projects/eop/chapter0/intro.py
index 94a9d9df1..2f4719118 100644
--- a/active_projects/eop/chapter0/intro.py
+++ b/active_projects/eop/chapter0/intro.py
@@ -21,7 +21,7 @@ class Introduction(TeacherStudentsScene):
this_video.save_state()
this_video.set_fill(opacity = 0)
this_video.center()
- this_video.scale_to_fit_height(FRAME_HEIGHT)
+ this_video.set_height(FRAME_HEIGHT)
self.this_video = this_video
diff --git a/active_projects/eop/chapter1/entire_brick_wall.py b/active_projects/eop/chapter1/entire_brick_wall.py
index 033cfbae8..65aed6e7a 100644
--- a/active_projects/eop/chapter1/entire_brick_wall.py
+++ b/active_projects/eop/chapter1/entire_brick_wall.py
@@ -100,7 +100,7 @@ class EntireBrickWall(BrickRowScene, MovingCameraScene):
brick_label = DecimalNumber(prob_percentage,
unit = "\%", num_decimal_places = 1, color = BLACK)
brick_label.move_to(brick_copy)
- brick_label.scale_to_fit_height(0.8 * brick_copy.get_height())
+ brick_label.set_height(0.8 * brick_copy.get_height())
return VGroup(brick_copy, brick_label)
highlighted_bricks = [
diff --git a/active_projects/eop/chapter1/million_flips.py b/active_projects/eop/chapter1/million_flips.py
index 5f2700628..0a4282c51 100644
--- a/active_projects/eop/chapter1/million_flips.py
+++ b/active_projects/eop/chapter1/million_flips.py
@@ -86,7 +86,7 @@ class MillionFlips(Scene):
def organize_group(self, group):
group.arrange_submobjects_in_grid(10)
- group.scale_to_fit_height(5)
+ group.set_height(5)
group.shift(DOWN + 2 * LEFT)
def increment(self, integer_mob, value=1):
diff --git a/active_projects/eop/chapter1/show_uncertainty_disease.py b/active_projects/eop/chapter1/show_uncertainty_disease.py
index db5b71ad7..503fe1eb2 100644
--- a/active_projects/eop/chapter1/show_uncertainty_disease.py
+++ b/active_projects/eop/chapter1/show_uncertainty_disease.py
@@ -12,7 +12,7 @@ class RandyIsSickOrNot(Scene):
randy = SicklyPiCreature()
- randy.scale_to_fit_height(3)
+ randy.set_height(3)
randy.move_to(2*LEFT)
randy.change_mode("plain")
randy.set_color(BLUE)
@@ -70,14 +70,14 @@ class OneIn200HasDisease(Scene):
]).arrange_submobjects(DOWN, SMALL_BUFF)
for x in range(10)
]).arrange_submobjects(RIGHT, SMALL_BUFF)
- all_creatures.scale_to_fit_height(FRAME_HEIGHT * 0.8)
+ all_creatures.set_height(FRAME_HEIGHT * 0.8)
all_creatures.next_to(title, DOWN)
randy = all_creatures[0][0]
all_creatures[0].remove(randy)
randy.change_mode("sick")
randy.set_color(SICKLY_GREEN)
randy.save_state()
- randy.scale_to_fit_height(3)
+ randy.set_height(3)
randy.center()
randy.change_mode("plain")
randy.set_color(BLUE)
diff --git a/active_projects/eop/combinations.py b/active_projects/eop/combinations.py
index 6f6a55eec..d4fc5b812 100644
--- a/active_projects/eop/combinations.py
+++ b/active_projects/eop/combinations.py
@@ -44,7 +44,7 @@ class Male(TexMobject):
def __init__(self, **kwargs):
digest_config(self, kwargs)
TexMobject.__init__(self, self.tex, **kwargs)
- self.scale_to_fit_height(self.height)
+ self.set_height(self.height)
self.set_color(self.color)
class Female(Male):
@@ -253,7 +253,7 @@ class InitialFiveChooseThreeExample(Scene):
binomial_equations.add(equation)
for stack, eq in zip(stacks, binomial_equations):
- eq.scale_to_fit_width(0.9*stack.get_width())
+ eq.set_width(0.9*stack.get_width())
eq.next_to(stack, UP)
mover = VGroup()
@@ -425,7 +425,7 @@ class SixChooseThreeExample(InitialFiveChooseThreeExample):
self.n, self.k,
vertical_buff = SMALL_BUFF
)
- stack.scale_to_fit_height(self.stack_height)
+ stack.set_height(self.stack_height)
stack.to_edge(DOWN)
for line in stack:
line.ones = VGroup(*filter(
@@ -652,7 +652,7 @@ class SixChooseThreeInOtherContext(Scene):
# )
# stacks.to_edge(DOWN, buff = LARGE_BUFF)
# for stack, eq in zip(stacks, binomial_equations):
-# eq.scale_to_fit_width(0.9*stack.get_width())
+# eq.set_width(0.9*stack.get_width())
# eq.next_to(stack, UP)
# self.play(
@@ -801,7 +801,7 @@ class SixChooseThreeInOtherContext(Scene):
# x = TexMobject("x").set_color(BLUE)
# y = TexMobject("y").set_color(RED)
# stack = get_stack(x, y, n, k)
-# stack.scale_to_fit_height(self.stack_height)
+# stack.set_height(self.stack_height)
# stack.shift(FRAME_X_RADIUS*LEFT/2)
# stack.to_edge(DOWN)
# numbers = VGroup(*[
@@ -845,7 +845,7 @@ class SixChooseThreeInOtherContext(Scene):
# )
# for letter_subset in letter_subsets
# ]).arrange_submobjects(DOWN, buff = MED_SMALL_BUFF)
-# subset_mobs.scale_to_fit_height(self.stack_height)
+# subset_mobs.set_height(self.stack_height)
# subset_mobs.shift(FRAME_X_RADIUS*RIGHT/2)
# subset_mobs.to_edge(DOWN)
@@ -1314,7 +1314,7 @@ class TeacherHoldingSomething(TeacherStudentsScene):
# title.set_color_by_tex("64", YELLOW)
# man, woman = Male(), Female()
# stacks = get_stacks(man, woman, 6, vertical_buff = SMALL_BUFF)
-# stacks.scale_to_fit_height(6.25)
+# stacks.set_height(6.25)
# stacks.to_edge(DOWN, buff = MED_SMALL_BUFF)
# women_groups = VGroup()
# for stack in stacks:
@@ -2065,7 +2065,7 @@ class StacksApproachBellCurve(Scene):
ns.generate_target()
for bar, number in zip(bs.target, ns.target):
# if number.get_width() > bar.get_width():
- # number.scale_to_fit_width(bar.get_width())
+ # number.set_width(bar.get_width())
number.next_to(bar, UP, SMALL_BUFF)
self.play(*map(MoveToTarget, [
@@ -2108,7 +2108,7 @@ class StacksApproachBellCurve(Scene):
if x > 1:
height = numbers.target[1].get_height()
for mob in numbers.target[0], numbers_copy.target[-1]:
- mob.scale_to_fit_height(height)
+ mob.set_height(height)
bars_copy.target[-1].align_to(bars, DOWN)
numbers_copy.target[-1].next_to(bars_copy.target[-1], UP, SMALL_BUFF)
@@ -2224,7 +2224,7 @@ class ChooseThreeFromFive(InitialFiveChooseThreeExample, PiCreatureScene):
mover = VGroup(*name_triplet).copy()
mover.generate_target()
if hasattr(self, "stack"):
- mover.target.scale_to_fit_height(self.stack[0].get_height())
+ mover.target.set_height(self.stack[0].get_height())
for name in mover.target[:2]:
name[-1].set_fill(opacity = 1)
mover.target.arrange_submobjects(RIGHT, MED_SMALL_BUFF)
@@ -3072,7 +3072,7 @@ class NineChooseFourExample(HowToComputeNChooseK):
aligned_edge = UP,
buff = MED_LARGE_BUFF
)
- columns.scale_to_fit_height(7)
+ columns.set_height(7)
columns.to_corner(DOWN + RIGHT)
for line in stack:
@@ -3268,7 +3268,7 @@ class ABCNotBCA(Scene):
equation.set_color(YELLOW)
equation.next_to(words, DOWN)
group = VGroup(words, equation)
- group.scale_to_fit_width(FRAME_WIDTH - 1)
+ group.set_width(FRAME_WIDTH - 1)
group.to_edge(DOWN)
self.add(words, equation)
@@ -3478,7 +3478,7 @@ class AskWhyTheyAreCalledBinomial(TeacherStudentsScene):
)
pascals = PascalsTriangle(n_rows = 6)
- pascals.scale_to_fit_height(3)
+ pascals.set_height(3)
pascals.to_corner(UP+LEFT, buff = MED_SMALL_BUFF)
pascals.set_color_by_gradient(BLUE, YELLOW)
diff --git a/active_projects/eop/independence.py b/active_projects/eop/independence.py
index 6998d6322..b23cd26f6 100644
--- a/active_projects/eop/independence.py
+++ b/active_projects/eop/independence.py
@@ -153,9 +153,9 @@ class DangerInProbability(Scene):
def get_warning_sign(self):
triangle = RegularPolygon(n = 3, start_angle = np.pi/2)
triangle.set_stroke(RED, 12)
- triangle.scale_to_fit_height(2)
+ triangle.set_height(2)
bang = TextMobject("!")
- bang.scale_to_fit_height(0.6*triangle.get_height())
+ bang.set_height(0.6*triangle.get_height())
bang.move_to(interpolate(
triangle.get_bottom(),
triangle.get_top(),
@@ -360,7 +360,7 @@ class IntroduceBinomial(Scene):
def add_p_slider(self):
interval = UnitInterval(color = LIGHT_GREY)
- interval.scale_to_fit_width(4)
+ interval.set_width(4)
interval.next_to(
VGroup(self.bar_chart.x_axis, self.bar_chart.y_axis),
UP, MED_LARGE_BUFF
@@ -372,7 +372,7 @@ class IntroduceBinomial(Scene):
fill_color = YELLOW,
fill_opacity = 1,
)
- triangle.scale_to_fit_height(0.25)
+ triangle.set_height(0.25)
triangle.move_to(interval.number_to_point(self.p), DOWN)
label = TexMobject("p")
label.next_to(triangle, UP, SMALL_BUFF)
@@ -500,7 +500,7 @@ class IntroduceQuiz(PiCreatureScene):
self.play(
LaggedStart(FadeIn, probabilities, run_time = 3),
- self.quiz.scale_to_fit_height, 0.7*self.randy.get_height(),
+ self.quiz.set_height, 0.7*self.randy.get_height(),
self.quiz.next_to, self.randy, RIGHT,
self.randy.change, "confused", probabilities
)
@@ -519,7 +519,7 @@ class IntroduceQuiz(PiCreatureScene):
)
chart.to_edge(RIGHT)
for short_p, bar in zip(self.abbreviated_probabilities, chart.bars):
- short_p.scale_to_fit_width(1.75*bar.get_width())
+ short_p.set_width(1.75*bar.get_width())
short_p.next_to(bar, UP)
self.play(
@@ -733,7 +733,7 @@ class AssociatePatternsWithScores(BreakDownQuestionPatterns):
class BeforeCounting(TeacherStudentsScene):
def construct(self):
triangle = PascalsTriangle(nrows = 7)
- triangle.scale_to_fit_height(4)
+ triangle.set_height(4)
triangle.next_to(self.teacher, UP+LEFT)
prob = get_probability_of_slot_group([True, True, False])
@@ -1156,7 +1156,7 @@ class ThousandPossibleQuizzes(Scene):
quiz[0].set_color(GREEN)
line = Line(UP, DOWN, color = YELLOW)
- line.scale_to_fit_height(self.quizzes.get_height())
+ line.set_height(self.quizzes.get_height())
line.next_to(bottom_movers.target, LEFT, MED_LARGE_BUFF, UP)
self.revert_to_original_skipping_status()
@@ -1227,7 +1227,7 @@ class ThousandPossibleQuizzes(Scene):
rows.arrange_submobjects(DOWN, buff = SMALL_BUFF)
quizzes = VGroup(*it.chain(*rows))
- quizzes.scale_to_fit_height(self.quizzes_height)
+ quizzes.set_height(self.quizzes_height)
quizzes.to_edge(RIGHT)
quizzes.shift(MED_LARGE_BUFF*DOWN)
return quizzes
@@ -1241,7 +1241,7 @@ class ExampleConditional(Scene):
rhs.set_color_by_tex("0.925", YELLOW)
rhs.next_to(prob, RIGHT)
expression = VGroup(prob, rhs)
- expression.scale_to_fit_width(FRAME_WIDTH - 1)
+ expression.set_width(FRAME_WIDTH - 1)
expression.center().to_edge(DOWN)
self.play(Write(expression))
@@ -1281,7 +1281,7 @@ class WritePSecond(Scene):
rhs = TexMobject("= 0.8")
rhs.next_to(prob, RIGHT)
prob.add(rhs)
- prob.scale_to_fit_width(FRAME_WIDTH - 1)
+ prob.set_width(FRAME_WIDTH - 1)
prob.center().to_edge(DOWN)
self.play(Write(prob))
@@ -1757,7 +1757,7 @@ class ShowFullDistribution(Scene):
])
for term, bar in zip(new_p_terms, chart.bars):
term[1].set_color(YELLOW)
- term.scale_to_fit_width(1.5*bar.get_width())
+ term.set_width(1.5*bar.get_width())
term.next_to(bar, UP)
self.play(
@@ -2523,7 +2523,7 @@ class CycleThroughPatterns(NameBinomial):
)
question.set_color_by_tex("male", BLUE)
question.set_color_by_tex("female", MAROON_B)
- question.scale_to_fit_width(FRAME_WIDTH - 1)
+ question.set_width(FRAME_WIDTH - 1)
question.to_edge(UP, buff = LARGE_BUFF)
self.add(question)
@@ -2797,7 +2797,7 @@ class GeneralBinomialDistributionValues(Scene):
def compare_to_pascal_row(self):
triangle = PascalsTriangle(nrows = 11)
- triangle.scale_to_fit_width(6)
+ triangle.set_width(6)
triangle.to_corner(UP+RIGHT)
last_row = VGroup(*[
triangle.coords_to_mobs[10][k]
@@ -2892,7 +2892,7 @@ class GeneralBinomialDistributionValues(Scene):
def play_with_p_value(self):
p = self.p
interval = UnitInterval(color = WHITE)
- interval.scale_to_fit_width(5)
+ interval.set_width(5)
interval.next_to(self.full_probability, DOWN, LARGE_BUFF)
interval.add_numbers(0, 0.5, 1)
triangle = RegularPolygon(
@@ -2901,7 +2901,7 @@ class GeneralBinomialDistributionValues(Scene):
fill_opacity = 1,
stroke_width = 0,
)
- triangle.scale_to_fit_height(0.25)
+ triangle.set_height(0.25)
triangle.move_to(interval.number_to_point(p), DOWN)
p_mob = TexMobject("p")
p_mob.set_color(MAROON_B)
@@ -3187,7 +3187,7 @@ class AssumeOrderDoesntMatter(Scene):
prob_group.arrange_submobjects(RIGHT)
max_width = FRAME_WIDTH - 1
if prob_group.get_width() > max_width:
- prob_group.scale_to_fit_width(max_width)
+ prob_group.set_width(max_width)
prob_groups.arrange_submobjects(DOWN, buff = 0.7)
prob_groups.next_to(self.title, DOWN, MED_LARGE_BUFF)
@@ -3414,7 +3414,7 @@ class SkepticalOfDistributions(TeacherStudentsScene):
values = values_list[-1],
bar_names = k_range
)
- chart.scale_to_fit_height(self.chart_height)
+ chart.set_height(self.chart_height)
chart.values_list = values_list
return chart
@@ -3430,7 +3430,7 @@ class SkepticalOfDistributions(TeacherStudentsScene):
bar_names = k_range,
bar_colors = [RED, YELLOW]
)
- chart.scale_to_fit_height(self.chart_height)
+ chart.set_height(self.chart_height)
title = TextMobject(
"Poisson distribution \\\\",
"$e^{-\\lambda}\\frac{\\lambda^k}{k!}$"
@@ -3452,7 +3452,7 @@ class SkepticalOfDistributions(TeacherStudentsScene):
fill_opacity = 1,
stroke_color = BLUE,
)
- graph.scale_to_fit_width(axes.get_width())
+ graph.set_width(axes.get_width())
graph.move_to(axes[0], DOWN)
title = TextMobject(
@@ -3546,7 +3546,7 @@ class Thumbnail(DangerInProbability):
warning = self.get_warning_sign()
- warning.scale_to_fit_height(2)
+ warning.set_height(2)
warning.to_edge(UP)
self.add(warning)
diff --git a/active_projects/eop/reusables/upright_coins.py b/active_projects/eop/reusables/upright_coins.py
index 2835455a4..399348c7a 100644
--- a/active_projects/eop/reusables/upright_coins.py
+++ b/active_projects/eop/reusables/upright_coins.py
@@ -19,7 +19,7 @@ class UprightCoin(Circle):
def __init__(self, **kwargs):
Circle.__init__(self,**kwargs)
self.symbol_mob = TextMobject(self.symbol, stroke_color = self.stroke_color)
- self.symbol_mob.scale_to_fit_height(0.5*self.get_height()).move_to(self)
+ self.symbol_mob.set_height(0.5*self.get_height()).move_to(self)
self.add(self.symbol_mob)
class UprightHeads(UprightCoin):
diff --git a/animation/specialized.py b/animation/specialized.py
index 31dc2fa5c..956ad880d 100644
--- a/animation/specialized.py
+++ b/animation/specialized.py
@@ -60,7 +60,7 @@ class Broadcast(LaggedStart):
)
circle.move_to(focal_point)
circle.save_state()
- circle.scale_to_fit_width(self.small_radius * 2)
+ circle.set_width(self.small_radius * 2)
circle.set_stroke(self.color, self.start_stroke_width)
circles.add(circle)
LaggedStart.__init__(
diff --git a/for_3b1b_videos/common_scenes.py b/for_3b1b_videos/common_scenes.py
index 74d3f6741..e32ad6019 100644
--- a/for_3b1b_videos/common_scenes.py
+++ b/for_3b1b_videos/common_scenes.py
@@ -79,7 +79,7 @@ class OpeningQuote(Scene):
quote.set_color_by_tex(term, color)
quote.to_edge(UP, buff=self.top_buff)
if quote.get_width() > max_width:
- quote.scale_to_fit_width(max_width)
+ quote.set_width(max_width)
return quote
def get_author(self, quote):
@@ -176,7 +176,7 @@ class PatreonEndScreen(PatreonThanks):
randy, morty = self.pi_creatures = VGroup(Randolph(), Mortimer())
for pi, vect in (randy, LEFT), (morty, RIGHT):
- pi.scale_to_fit_height(title.get_height())
+ pi.set_height(title.get_height())
pi.change_mode("thinking")
pi.look(DOWN)
pi.next_to(title, vect, buff=MED_LARGE_BUFF)
@@ -204,7 +204,7 @@ class PatreonEndScreen(PatreonThanks):
thanks.next_to(black_rect.get_bottom(), UP, SMALL_BUFF)
thanks.set_color(YELLOW)
underline = Line(LEFT, RIGHT)
- underline.scale_to_fit_width(thanks.get_width() + MED_SMALL_BUFF)
+ underline.set_width(thanks.get_width() + MED_SMALL_BUFF)
underline.next_to(thanks, DOWN, SMALL_BUFF)
thanks.add(underline)
self.add(thanks)
@@ -213,7 +213,7 @@ class PatreonEndScreen(PatreonThanks):
patrons.scale(self.patron_scale_val)
for patron in patrons:
if patron.get_width() > self.max_patron_width:
- patron.scale_to_fit_width(self.max_patron_width)
+ patron.set_width(self.max_patron_width)
columns = VGroup(*[
VGroup(*patrons[i::self.n_patron_columns])
for i in range(self.n_patron_columns)
@@ -225,7 +225,7 @@ class PatreonEndScreen(PatreonThanks):
RIGHT, buff=LARGE_BUFF,
aligned_edge=UP,
)
- columns.scale_to_fit_width(total_width - 1)
+ columns.set_width(total_width - 1)
columns.next_to(black_rect, DOWN, 3 * LARGE_BUFF)
columns.to_edge(RIGHT)
diff --git a/mobject/coordinate_systems.py b/mobject/coordinate_systems.py
index ed728d4e1..f238e0e28 100644
--- a/mobject/coordinate_systems.py
+++ b/mobject/coordinate_systems.py
@@ -252,7 +252,7 @@ class NumberPlane(VMobject):
point = self.coords_to_point(*num_pair)
num = TexMobject(str(val))
num.add_background_rectangle()
- num.scale_to_fit_height(
+ num.set_height(
self.written_coordinate_height
)
num.next_to(point, DOWN + LEFT, buff=SMALL_BUFF)
@@ -347,7 +347,7 @@ class ComplexPlane(NumberPlane):
num_str = num_str.replace("1", "")
num_mob = TexMobject(num_str)
num_mob.add_background_rectangle()
- num_mob.scale_to_fit_height(self.written_coordinate_height)
+ num_mob.set_height(self.written_coordinate_height)
num_mob.next_to(point, DOWN + LEFT, SMALL_BUFF)
result.add(num_mob)
self.coordinate_labels = result
diff --git a/mobject/frame.py b/mobject/frame.py
index cd51dcf6c..a197d474b 100644
--- a/mobject/frame.py
+++ b/mobject/frame.py
@@ -47,4 +47,4 @@ class PictureInPictureFrame(Rectangle):
height=self.aspect_ratio[1],
**kwargs
)
- self.scale_to_fit_height(height)
+ self.set_height(height)
diff --git a/mobject/geometry.py b/mobject/geometry.py
index 37879d6aa..3cd4a00d5 100644
--- a/mobject/geometry.py
+++ b/mobject/geometry.py
@@ -177,7 +177,7 @@ class Circle(Arc):
# TODO: Figure out and fix
self.replace(mobject, dim_to_match, stretch)
- self.scale_to_fit_width(
+ self.set_width(
np.sqrt(mobject.get_width()**2 + mobject.get_height()**2))
self.scale(buffer_factor)
diff --git a/mobject/mobject.py b/mobject/mobject.py
index fb30d3cbb..ae707224a 100644
--- a/mobject/mobject.py
+++ b/mobject/mobject.py
@@ -419,14 +419,14 @@ class Mobject(Container):
def stretch_to_fit_depth(self, depth, **kwargs):
return self.rescale_to_fit(depth, 1, stretch=True, **kwargs)
- def scale_to_fit_width(self, width, **kwargs):
- return self.rescale_to_fit(width, 0, stretch=False, **kwargs)
+ def set_width(self, width, stretch=False, **kwargs):
+ return self.rescale_to_fit(width, 0, stretch=stretch, **kwargs)
- def scale_to_fit_height(self, height, **kwargs):
- return self.rescale_to_fit(height, 1, stretch=False, **kwargs)
+ def set_height(self, height, stretch=False, **kwargs):
+ return self.rescale_to_fit(height, 1, stretch=stretch, **kwargs)
- def scale_to_fit_depth(self, depth, **kwargs):
- return self.rescale_to_fit(depth, 2, stretch=False, **kwargs)
+ def set_depth(self, depth, stretch=False, **kwargs):
+ return self.rescale_to_fit(depth, 2, stretch=stretch, **kwargs)
def space_out_submobjects(self, factor=1.5, **kwargs):
self.scale(factor, **kwargs)
diff --git a/mobject/probability.py b/mobject/probability.py
index 9f7b923bc..dbc95b2fe 100644
--- a/mobject/probability.py
+++ b/mobject/probability.py
@@ -32,7 +32,7 @@ class SampleSpace(Rectangle):
# TODO, should this really exist in SampleSpaceScene
title_mob = TextMobject(title)
if title_mob.get_width() > self.get_width():
- title_mob.scale_to_fit_width(self.get_width())
+ title_mob.set_width(self.get_width())
title_mob.next_to(self, UP, buff=buff)
self.title = title_mob
self.add(title_mob)
@@ -181,7 +181,7 @@ class BarChart(VGroup):
values = np.linspace(0, self.max_value, self.n_ticks + 1)
for y, value in zip(heights, values):
tick = Line(LEFT, RIGHT)
- tick.scale_to_fit_width(self.tick_width)
+ tick.set_width(self.tick_width)
tick.move_to(y * UP)
ticks.add(tick)
y_axis.add(ticks)
@@ -193,7 +193,7 @@ class BarChart(VGroup):
labels = VGroup()
for tick, value in zip(ticks, values):
label = TexMobject(str(np.round(value, 2)))
- label.scale_to_fit_height(self.y_axis_label_height)
+ label.set_height(self.y_axis_label_height)
label.next_to(tick, LEFT, SMALL_BUFF)
labels.add(label)
self.y_axis_labels = labels
diff --git a/mobject/svg/drawings.py b/mobject/svg/drawings.py
index 664010051..5005a4d52 100644
--- a/mobject/svg/drawings.py
+++ b/mobject/svg/drawings.py
@@ -77,7 +77,7 @@ class SunGlasses(SVGMobject):
SVGMobject.__init__(self, **kwargs)
self.set_stroke(WHITE, width=0)
self.set_fill(GREY, 1)
- self.scale_to_fit_width(
+ self.set_width(
self.glasses_width_to_eyes_width * pi_creature.eyes.get_width()
)
self.move_to(pi_creature.eyes, UP)
@@ -105,7 +105,7 @@ class Speedometer(VMobject):
vect = rotate_vector(RIGHT, angle)
tick = Line((1 - self.tick_length) * vect, vect)
label = TexMobject(str(10 * index))
- label.scale_to_fit_height(self.tick_length)
+ label.set_height(self.tick_length)
label.shift((1 + self.tick_length) * vect)
self.add(tick, label)
@@ -169,7 +169,7 @@ class AoPSLogo(SVGMobject):
for i in index_list:
self.submobjects[i].set_fill(color, opacity=1)
- self.scale_to_fit_height(self.height)
+ self.set_height(self.height)
self.center()
@@ -190,7 +190,7 @@ class PartyHat(SVGMobject):
def __init__(self, **kwargs):
SVGMobject.__init__(self, **kwargs)
- self.scale_to_fit_height(self.height)
+ self.set_height(self.height)
if self.pi_creature is not None:
self.next_to(self.pi_creature.eyes, UP, buff=0)
@@ -225,7 +225,7 @@ class Laptop(VGroup):
body = Cube(side_length=1)
for dim, scale_factor in enumerate(self.body_dimensions):
body.stretch(scale_factor, dim=dim)
- body.scale_to_fit_width(self.width)
+ body.set_width(self.width)
body.set_fill(self.shaded_body_color, opacity=1)
body.sort_submobjects(lambda p: p[2])
body[-1].set_fill(self.body_color)
@@ -292,7 +292,7 @@ class PatreonLogo(SVGMobject):
def __init__(self, **kwargs):
SVGMobject.__init__(self, **kwargs)
- self.scale_to_fit_width(self.width)
+ self.set_width(self.width)
self.center()
@@ -305,7 +305,7 @@ class VideoIcon(SVGMobject):
def __init__(self, **kwargs):
SVGMobject.__init__(self, **kwargs)
self.center()
- self.scale_to_fit_width(self.width)
+ self.set_width(self.width)
self.set_stroke(color=WHITE, width=0)
self.set_fill(color=WHITE, opacity=1)
@@ -321,7 +321,7 @@ class VideoSeries(VGroup):
videos = [VideoIcon() for x in range(self.num_videos)]
VGroup.__init__(self, *videos, **kwargs)
self.arrange_submobjects()
- self.scale_to_fit_width(FRAME_WIDTH - MED_LARGE_BUFF)
+ self.set_width(FRAME_WIDTH - MED_LARGE_BUFF)
self.set_color_by_gradient(*self.gradient_colors)
@@ -337,12 +337,12 @@ class Headphones(SVGMobject):
digest_config(self, kwargs)
SVGMobject.__init__(self, file_name=self.file_name, **kwargs)
self.stretch(self.y_stretch_factor, 1)
- self.scale_to_fit_height(self.height)
+ self.set_height(self.height)
self.set_stroke(width=0)
self.set_fill(color=self.color)
if pi_creature is not None:
eyes = pi_creature.eyes
- self.scale_to_fit_height(3 * eyes.get_height())
+ self.set_height(3 * eyes.get_height())
self.move_to(eyes, DOWN)
self.shift(DOWN * eyes.get_height() / 4)
@@ -473,7 +473,7 @@ class Bubble(SVGMobject):
def position_mobject_inside(self, mobject):
scaled_width = self.content_scale_factor * self.get_width()
if mobject.get_width() > scaled_width:
- mobject.scale_to_fit_width(scaled_width)
+ mobject.set_width(scaled_width)
mobject.shift(
self.get_bubble_center() - mobject.get_center()
)
@@ -544,13 +544,13 @@ class Car(SVGMobject):
def __init__(self, **kwargs):
SVGMobject.__init__(self, **kwargs)
- self.scale_to_fit_height(self.height)
+ self.set_height(self.height)
self.set_stroke(color=WHITE, width=0)
self.set_fill(self.color, opacity=1)
from for_3b1b_videos.pi_creature import Randolph
randy = Randolph(mode="happy")
- randy.scale_to_fit_height(0.6 * self.get_height())
+ randy.set_height(0.6 * self.get_height())
randy.stretch(0.8, 0)
randy.look(RIGHT)
randy.move_to(self)
@@ -958,7 +958,7 @@ class PlayingCard(VGroup):
mode=pi_mode,
color=pi_color,
)
- pi_creature.scale_to_fit_width(0.8 * sub_rect.get_width())
+ pi_creature.set_width(0.8 * sub_rect.get_width())
if value in ["Q", "K"]:
prefix = "king" if value == "K" else "queen"
crown = SVGMobject(file_name=prefix + "_crown")
@@ -983,7 +983,7 @@ class PlayingCard(VGroup):
value_mob = TextMobject(value)
width = self.get_width() / self.card_width_to_corner_num_width
height = self.get_height() / self.card_height_to_corner_num_height
- value_mob.scale_to_fit_width(width)
+ value_mob.set_width(width)
value_mob.stretch_to_fit_height(height)
value_mob.next_to(
self.get_corner(UP + LEFT), DOWN + RIGHT,
@@ -991,7 +991,7 @@ class PlayingCard(VGroup):
)
value_mob.set_color(symbol.get_color())
corner_symbol = symbol.copy()
- corner_symbol.scale_to_fit_width(width)
+ corner_symbol.set_width(width)
corner_symbol.next_to(
value_mob, DOWN,
buff=MED_SMALL_BUFF * width
@@ -1029,4 +1029,4 @@ class SuitSymbol(SVGMobject):
color = suits_to_colors[suit_name]
self.set_stroke(width=0)
self.set_fill(color, 1)
- self.scale_to_fit_height(self.height)
+ self.set_height(self.height)
diff --git a/mobject/svg/svg_mobject.py b/mobject/svg/svg_mobject.py
index 81cfc347e..2ad45c515 100644
--- a/mobject/svg/svg_mobject.py
+++ b/mobject/svg/svg_mobject.py
@@ -272,9 +272,9 @@ class SVGMobject(VMobject):
if self.should_center:
self.center()
if self.height is not None:
- self.scale_to_fit_height(self.height)
+ self.set_height(self.height)
if self.width is not None:
- self.scale_to_fit_width(self.width)
+ self.set_width(self.width)
class VMobjectFromSVGPathstring(VMobject):
diff --git a/mobject/svg/tex_mobject.py b/mobject/svg/tex_mobject.py
index 518461207..13d5f572c 100644
--- a/mobject/svg/tex_mobject.py
+++ b/mobject/svg/tex_mobject.py
@@ -330,6 +330,6 @@ class Title(TextMobject):
if self.match_underline_width_to_text:
underline.match_width(self)
else:
- underline.scale_to_fit_width(self.underline_width)
+ underline.set_width(self.underline_width)
self.add(underline)
self.underline = underline
diff --git a/old_projects/256.py b/old_projects/256.py
index 293efe5ca..f413d3686 100644
--- a/old_projects/256.py
+++ b/old_projects/256.py
@@ -140,7 +140,7 @@ class BreakUp2To256(PiCreatureScene):
])
target.arrange_submobjects(RIGHT, buff = SMALL_BUFF)
target.to_edge(UP)
- target.scale_to_fit_width(FRAME_WIDTH - LARGE_BUFF)
+ target.set_width(FRAME_WIDTH - LARGE_BUFF)
parens = VGroup(*it.chain(*[
[t[0], t[2]] for t in target
]))
@@ -211,7 +211,7 @@ class MainBreakdown(Scene):
top_line.add(mob)
four_billions.add(mob[1])
top_line.arrange_submobjects(RIGHT, buff = SMALL_BUFF)
- top_line.scale_to_fit_width(FRAME_WIDTH - LARGE_BUFF)
+ top_line.set_width(FRAME_WIDTH - LARGE_BUFF)
top_line.to_edge(UP)
four_billions.set_color(YELLOW)
self.add(top_line)
@@ -438,7 +438,7 @@ class MainBreakdown(Scene):
3, self.get_earth()
)
milky_way = ImageMobject("milky_way")
- milky_way.scale_to_fit_height(3)
+ milky_way.set_height(3)
milky_way.to_edge(LEFT, buff = 0)
milky_way.shift(DOWN)
@@ -558,7 +558,7 @@ class MainBreakdown(Scene):
group = VGroup(*[
VGroup(*[
- mobject.copy().scale_to_fit_height(0.25)
+ mobject.copy().set_height(0.25)
for x in range(self.n_group_rows)
]).arrange_submobjects(DOWN, buff = SMALL_BUFF)
for y in range(self.n_group_cols-1)
@@ -567,10 +567,10 @@ class MainBreakdown(Scene):
group.add(dots)
group.add(*[group[0].copy() for x in range(2)])
group.arrange_submobjects(RIGHT, buff = SMALL_BUFF)
- group.scale_to_fit_height(FRAME_Y_RADIUS)
+ group.set_height(FRAME_Y_RADIUS)
max_width = 1.25*FRAME_X_RADIUS
if group.get_width() > max_width:
- group.scale_to_fit_width(max_width)
+ group.set_width(max_width)
group.to_corner(DOWN+RIGHT)
group = VGroup(*it.chain(*group))
@@ -598,13 +598,13 @@ class MainBreakdown(Scene):
space = LARGE_BUFF
h_line = Line(LEFT, RIGHT)
- h_line.scale_to_fit_width(four_billion.get_width())
+ h_line.set_width(four_billion.get_width())
h_line.next_to(four_billion, DOWN, space)
for mob in numerator, denominator:
- mob.scale_to_fit_height(0.75*space)
+ mob.set_height(0.75*space)
max_width = h_line.get_width()
if mob.get_width() > max_width:
- mob.scale_to_fit_width(max_width)
+ mob.set_width(max_width)
numerator.next_to(h_line, UP, SMALL_BUFF)
denominator.next_to(h_line, DOWN, SMALL_BUFF)
fraction = VGroup(numerator, h_line, denominator)
@@ -662,7 +662,7 @@ class StateOfBitcoin(TeacherStudentsScene):
title = TextMobject("Total", "B", "mining")
title.to_edge(UP)
bitcoin_logo = BitcoinLogo()
- bitcoin_logo.scale_to_fit_height(0.5)
+ bitcoin_logo.set_height(0.5)
bitcoin_logo.move_to(title[1])
title.remove(title[1])
@@ -814,7 +814,7 @@ class QAndA(PiCreatureScene):
]).arrange_submobjects(DOWN, buff = SMALL_BUFF)
for y in range(cols)
]).arrange_submobjects(RIGHT, buff = SMALL_BUFF)
- dots.scale_to_fit_width(FRAME_WIDTH - 2*LARGE_BUFF)
+ dots.set_width(FRAME_WIDTH - 2*LARGE_BUFF)
dots.next_to(self.pi_creature, UP)
dots = VGroup(*it.chain(*dots))
top = dots.get_top()
@@ -853,7 +853,7 @@ class QAndA(PiCreatureScene):
class Thumbnail(Scene):
def construct(self):
num = TexMobject("2^{256}")
- num.scale_to_fit_height(2)
+ num.set_height(2)
num.set_color(BLUE_C)
num.set_stroke(BLUE_B, 3)
num.shift(MED_SMALL_BUFF*UP)
@@ -871,7 +871,7 @@ class Thumbnail(Scene):
if i%(n_chars/4) == 0:
new_str += " \\\\ "
background_num = TexMobject(new_str)
- background_num.scale_to_fit_width(FRAME_WIDTH - LARGE_BUFF)
+ background_num.set_width(FRAME_WIDTH - LARGE_BUFF)
background_num.set_fill(opacity = 0.2)
secure = TextMobject("Secure?")
@@ -884,7 +884,7 @@ class Thumbnail(Scene):
file_name = "shield_locked",
fill_color = WHITE,
)
- lock.scale_to_fit_height(6)
+ lock.set_height(6)
self.add(background_num, num)
diff --git a/old_projects/WindingNumber_G.py b/old_projects/WindingNumber_G.py
index cb5def507..07fc2c58c 100644
--- a/old_projects/WindingNumber_G.py
+++ b/old_projects/WindingNumber_G.py
@@ -488,7 +488,7 @@ class Introduce1DFunctionCase(Scene):
# show_ellipsis = True,
)
height = self.rect.get_height()
- decimal.scale_to_fit_height(height)
+ decimal.set_height(height)
next_to_kwargs = {
"buff" : height,
}
@@ -1065,7 +1065,7 @@ class TwoDScreenInOurThreeDWorld(AltTeacherStudentsScene, ThreeDScene):
def ask_about_2d_functions(self):
in_plane = NumberPlane(x_radius = 2.5, y_radius = 2.5)
in_plane.add_coordinates()
- in_plane.scale_to_fit_height(3)
+ in_plane.set_height(3)
out_plane = in_plane.copy()
in_text = TextMobject("Input space")
@@ -1530,7 +1530,7 @@ class OneDRegionBoundary(Scene):
region.move_to(line)
region_words = TextMobject("Input region")
- region_words.scale_to_fit_width(0.8*region.get_width())
+ region_words.set_width(0.8*region.get_width())
region_words.next_to(region, UP)
x0_arrow, x1_arrow = arrows = VGroup(*[
@@ -2899,7 +2899,7 @@ class AllOfTheVideos(Scene):
rect.set_stroke(WHITE, 1)
image.add(rect)
images.arrange_submobjects_in_grid(n, n, buff = 0)
- images.scale_to_fit_height(FRAME_HEIGHT)
+ images.set_height(FRAME_HEIGHT)
random.shuffle(images.submobjects)
self.play(LaggedStart(FadeIn, images, run_time = 4))
@@ -2963,7 +2963,7 @@ class TickingClock(Scene):
}
def construct(self):
clock = Clock()
- clock.scale_to_fit_height(FRAME_HEIGHT - 1)
+ clock.set_height(FRAME_HEIGHT - 1)
clock.to_edge(LEFT)
lines = [clock.hour_hand, clock.minute_hand]
def update_line(line):
diff --git a/old_projects/alt_calc.py b/old_projects/alt_calc.py
index ee1b953c4..2d69bc9e4 100644
--- a/old_projects/alt_calc.py
+++ b/old_projects/alt_calc.py
@@ -287,7 +287,7 @@ class NumberlineTransformationScene(ZoomedScene):
frame.generate_target()
frame.target.move_to(input_point)
if zoom_factor:
- frame.target.scale_to_fit_height(
+ frame.target.set_height(
self.zoomed_display.get_height() * zoom_factor
)
movement = MoveToTarget(frame)
@@ -360,7 +360,7 @@ class NumberlineTransformationScene(ZoomedScene):
result.add(result.tick_marks, result.numbers)
for x in x_values:
tick_mark = Line(UP, DOWN)
- tick_mark.scale_to_fit_height(
+ tick_mark.set_height(
0.15 * self.zoomed_camera.frame.get_height()
)
tick_mark.move_to(line.number_to_point(x))
@@ -454,7 +454,7 @@ class WriteOpeningWords(Scene):
]
words1.next_to(words2, UP, aligned_edge=LEFT, buff=LARGE_BUFF)
words = VGroup(*it.chain(words1, words2))
- words.scale_to_fit_width(FRAME_WIDTH - 2 * LARGE_BUFF)
+ words.set_width(FRAME_WIDTH - 2 * LARGE_BUFF)
words.to_edge(UP)
letter_wait = 0.05
@@ -559,7 +559,7 @@ class StartingCalc101(PiCreatureScene):
rects = images[-1].rects.copy()
rects.center()
- rects.scale_to_fit_height(FRAME_HEIGHT - 1)
+ rects.set_height(FRAME_HEIGHT - 1)
# image = rects.get_image()
open_cv_image = cv2.imread(get_full_raster_image_path("alt_calc_hidden_image"))
blurry_iamge = cv2.blur(open_cv_image, (50, 50))
@@ -624,11 +624,11 @@ class StartingCalc101(PiCreatureScene):
return images
def adjust_size(self, group):
- group.scale_to_fit_width(min(
+ group.set_width(min(
group.get_width(),
self.image_frame_width - 2 * MED_SMALL_BUFF
))
- group.scale_to_fit_height(min(
+ group.set_height(min(
group.get_height(),
self.image_frame_height - 2 * MED_SMALL_BUFF
))
@@ -696,7 +696,7 @@ class StartingCalc101(PiCreatureScene):
weight.set_stroke(width=0)
weight.set_fill(opacity=1)
weight.color_using_background_image("grey_gradient")
- weight.scale_to_fit_height(0.4)
+ weight.set_height(0.4)
t_tracker = ValueTracker(0)
group = VGroup(spring, weight)
@@ -741,7 +741,7 @@ class StartingCalc101(PiCreatureScene):
creature = self.pi_creature.copy()
creature.change_mode("angry")
equation = TexMobject("\\frac{d}{dx}(x^x)")
- equation.scale_to_fit_height(creature.get_height() / 2)
+ equation.set_height(creature.get_height() / 2)
equation.next_to(creature, RIGHT, aligned_edge=UP)
creature.look_at(equation)
return VGroup(creature, equation)
@@ -758,7 +758,7 @@ class StartingCalc101(PiCreatureScene):
scene.cube, scene.faces,
scene.bars, scene.corner_cube,
)
- group.scale_to_fit_height(0.75 * creature.get_height())
+ group.set_height(0.75 * creature.get_height())
group.next_to(creature, RIGHT)
creature.look_at(group)
return VGroup(creature, group)
@@ -1067,7 +1067,7 @@ class StandardDerivativeVisual(GraphScene):
title = self.title = TextMobject("Standard derivative visual")
title.to_edge(UP)
h_line = Line(LEFT, RIGHT)
- h_line.scale_to_fit_width(FRAME_WIDTH - 2 * LARGE_BUFF)
+ h_line.set_width(FRAME_WIDTH - 2 * LARGE_BUFF)
h_line.next_to(title, DOWN)
self.add(title, h_line)
@@ -1869,7 +1869,7 @@ class ZoomInMoreAndMoreToZero(ZoomInOnXSquaredNearZero):
last_zoom_words = None
for factor in 0.1, 0.01, 0.001, 0.0001:
frame.save_state()
- frame.scale_to_fit_height(factor * zoomed_display_height)
+ frame.set_height(factor * zoomed_display_height)
self.local_coordinate_num_decimal_places = int(-np.log10(factor))
zoom_words = TextMobject(
"Zoomed", "{:,}x \\\\".format(int(1.0 / factor)),
@@ -2541,13 +2541,13 @@ class RepeatedApplicationWithNegativeSeed(RepeatedApplicationWithPhiBro, MovingC
self.play(ShowCreation(rect))
self.play(
Write(question),
- self.camera.frame.scale_to_fit_height, FRAME_HEIGHT + 1.5
+ self.camera.frame.set_height, FRAME_HEIGHT + 1.5
)
self.wait()
self.play(
FadeOut(question),
FadeOut(rect),
- self.camera.frame.scale_to_fit_height, FRAME_HEIGHT
+ self.camera.frame.set_height, FRAME_HEIGHT
)
@@ -3176,7 +3176,7 @@ class AnalyzeFunctionWithTransformations(NumberlineTransformationScene):
deriv_text[0][10:14].set_color(YELLOW)
self.play(
- zoomed_frame.scale_to_fit_height, 4,
+ zoomed_frame.set_height, 4,
zoomed_frame.center,
self.deriv_text.fade, 1,
run_time=2
@@ -3325,7 +3325,7 @@ class StabilityAndInstability(AnalyzeFunctionWithTransformations):
class StaticAlgebraicObject(Scene):
def construct(self):
frac = get_phi_continued_fraction(40)
- frac.scale_to_fit_width(FRAME_WIDTH - 1)
+ frac.set_width(FRAME_WIDTH - 1)
# frac.shift(2 * DOWN)
frac.to_edge(DOWN)
frac.set_stroke(WHITE, width=0.5)
@@ -3580,7 +3580,7 @@ class PrinciplesOverlay(PiCreatureScene):
class ManyInfiniteExpressions(Scene):
def construct(self):
frac = get_phi_continued_fraction(10)
- frac.scale_to_fit_height(2)
+ frac.set_height(2)
frac.to_corner(UL)
n = 9
diff --git a/old_projects/basel/basel.py b/old_projects/basel/basel.py
index 0ec5b669b..be7ca4572 100644
--- a/old_projects/basel/basel.py
+++ b/old_projects/basel/basel.py
@@ -527,7 +527,7 @@ class IntroScene(PiCreatureScene):
q_mark.next_to(q_circle)
thought = Group(q_circle, q_mark)
- q_mark.scale_to_fit_height(0.6 * q_circle.get_height())
+ q_mark.set_height(0.6 * q_circle.get_height())
self.look_at(pi_squared)
self.pi_creature_thinks(thought,target_mode = "confused",
@@ -1738,7 +1738,7 @@ class BackToEulerSumScene(PiCreatureScene):
show_reading = False
)
indicator_reading = euler_sum[0]
- indicator_reading.scale_to_fit_height(0.5 * indicator.get_height())
+ indicator_reading.set_height(0.5 * indicator.get_height())
indicator_reading.move_to(indicator.get_center())
indicator.add(indicator_reading)
indicator.tex_reading = indicator_reading
@@ -1785,7 +1785,7 @@ class BackToEulerSumScene(PiCreatureScene):
# center it in the indicator
if bubble_indicator_target.tex_reading.get_tex_string() != "1":
- bubble_indicator_target.tex_reading.scale_to_fit_height(0.8*indicator.get_height())
+ bubble_indicator_target.tex_reading.set_height(0.8*indicator.get_height())
# the target is less bright, possibly switch to a white text color
if bubble_indicator_target.intensity < 0.7:
bubble_indicator.tex_reading.set_fill(color = WHITE)
@@ -1848,7 +1848,7 @@ class BackToEulerSumScene(PiCreatureScene):
sum_indicator.set_intensity(intensities[0] * np.pi**2/6)
sum_indicator_reading = TexMobject("{\pi^2 \over 6}")
sum_indicator_reading.set_fill(color = BLACK)
- sum_indicator_reading.scale_to_fit_height(0.8 * sum_indicator.get_height())
+ sum_indicator_reading.set_height(0.8 * sum_indicator.get_height())
sum_indicator.add(sum_indicator_reading)
sum_indicator.move_to(collection_point)
@@ -3152,7 +3152,7 @@ class PondScene(ThreeDScene):
# first lighthouse
original_op_func = inverse_quadratic(LIGHT_MAX_INT,LIGHT_SCALE,LIGHT_CUTOFF)
ls0 = LightSource(opacity_function = original_op_func, radius = 15.0, num_levels = 15)
- ls0.lighthouse.scale_to_fit_height(LIGHTHOUSE_HEIGHT)
+ ls0.lighthouse.set_height(LIGHTHOUSE_HEIGHT)
ls0.lighthouse.height = LIGHTHOUSE_HEIGHT
ls0.move_source_to(OBSERVER_POINT + LAKE0_RADIUS * 2 * UP)
self.zoomable_mobs.add(ls0, ls0.lighthouse, ls0.ambient_light)
diff --git a/old_projects/basel/basel2.py b/old_projects/basel/basel2.py
index 884168db6..afa417e41 100644
--- a/old_projects/basel/basel2.py
+++ b/old_projects/basel/basel2.py
@@ -97,7 +97,7 @@ class LightIndicator(Mobject):
self.add(self.background, self.foreground)
self.reading = DecimalNumber(self.intensity,num_decimal_places = self.precision)
self.reading.set_fill(color=INDICATOR_TEXT_COLOR)
- self.reading.scale_to_fit_height(self.reading_height)
+ self.reading.set_height(self.reading_height)
self.reading.move_to(self.get_center())
if self.show_reading:
self.add(self.reading)
@@ -368,7 +368,7 @@ class IntroScene(PiCreatureScene):
rect_label.scale(0.75)
max_width = 0.7*rect.get_width()
if rect_label.get_width() > max_width:
- rect_label.scale_to_fit_width(max_width)
+ rect_label.set_width(max_width)
rect_label.next_to(rect, UP, buff = MED_LARGE_BUFF/(i+1))
term_mobject = term_mobjects[i-1]
@@ -388,7 +388,7 @@ class IntroScene(PiCreatureScene):
lines.add(line)
dots = TexMobject("\\dots").scale(0.5)
last_rect = rect_anims[-1].target_mobject
- dots.scale_to_fit_width(0.9*last_rect.get_width())
+ dots.set_width(0.9*last_rect.get_width())
dots.move_to(last_rect, UP+RIGHT)
rects.submobjects[-1] = dots
rect_anims[-1] = FadeIn(dots)
@@ -493,7 +493,7 @@ class IntroScene(PiCreatureScene):
pi = pi_answer[0]
pi_rect = SurroundingRectangle(pi, color = RED)
pi_rect.save_state()
- pi_rect.scale_to_fit_height(FRAME_Y_RADIUS)
+ pi_rect.set_height(FRAME_Y_RADIUS)
pi_rect.center()
pi_rect.set_stroke(width = 0)
squared = pi_answer[1]
@@ -605,7 +605,7 @@ class IntroScene(PiCreatureScene):
q_mark.next_to(q_circle)
thought = Group(q_circle, q_mark)
- q_mark.scale_to_fit_height(0.8 * q_circle.get_height())
+ q_mark.set_height(0.8 * q_circle.get_height())
self.pi_creature_thinks(thought,target_mode = "confused",
bubble_kwargs = { "height" : 2, "width" : 3 })
@@ -796,7 +796,7 @@ class MathematicalWebOfConnections(PiCreatureScene):
for i in range(4)
for j in range(7+(i%2))
])
- dots.scale_to_fit_height(3)
+ dots.set_height(3)
dots.next_to(title, DOWN, MED_LARGE_BUFF)
edges = VGroup()
for x in range(100):
@@ -1230,7 +1230,7 @@ class IntroduceScreen(Scene):
# Camera
camera = SVGMobject(file_name = "camera")
camera.rotate(TAU/4)
- camera.scale_to_fit_height(1.5)
+ camera.set_height(1.5)
camera.move_to(morty.eyes, LEFT)
# Animations
@@ -1526,7 +1526,7 @@ class ShowLightInThreeDimensions(IntroduceScreen, ThreeDScene):
Circle().insert_n_anchor_points(25),
)
for screen in screens:
- screen.scale_to_fit_height(self.screen_height)
+ screen.set_height(self.screen_height)
screens.rotate(TAU/4, UP)
screens.next_to(self.observer_point, LEFT)
screens.set_stroke(WHITE, 2)
@@ -2331,7 +2331,7 @@ class MathologerVideoWrapper(Scene):
# title.scale(0.7)
title.to_edge(UP)
logo = ImageMobject("mathologer_logo")
- logo.scale_to_fit_height(1)
+ logo.set_height(1)
logo.to_corner(UP+LEFT)
logo.shift(FRAME_WIDTH*RIGHT)
screen = ScreenRectangle(height = 5.5)
@@ -3011,7 +3011,7 @@ class PondScene(ThreeDScene):
# first lighthouse
original_op_func = inverse_quadratic(LIGHT_MAX_INT,LIGHT_SCALE,LIGHT_CUTOFF)
ls0 = LightSource(opacity_function = original_op_func, radius = 15.0, num_levels = 150)
- ls0.lighthouse.scale_to_fit_height(LIGHTHOUSE_HEIGHT)
+ ls0.lighthouse.set_height(LIGHTHOUSE_HEIGHT)
ls0.lighthouse.height = LIGHTHOUSE_HEIGHT
ls0.move_source_to(OBSERVER_POINT + LAKE0_RADIUS * 2 * UP)
self.zoomable_mobs.add(ls0, ls0.lighthouse, ls0.ambient_light)
@@ -3044,7 +3044,7 @@ class PondScene(ThreeDScene):
# New introduction
lake0.save_state()
morty.save_state()
- lake0.scale_to_fit_height(6)
+ lake0.set_height(6)
morty.to_corner(UP+LEFT)
morty.fade(1)
lake0.center()
@@ -3760,14 +3760,14 @@ class CenterOfLargerCircleOverlayText(Scene):
arrow = Vector(DOWN+LEFT, color = WHITE)
arrow.shift(words.get_bottom() + SMALL_BUFF*DOWN - arrow.get_start())
group = VGroup(words, arrow)
- group.scale_to_fit_height(FRAME_HEIGHT - 1)
+ group.set_height(FRAME_HEIGHT - 1)
group.to_edge(UP)
self.add(group)
class DiameterWordOverlay(Scene):
def construct(self):
word = TextMobject("Diameter")
- word.scale_to_fit_width(FRAME_X_RADIUS)
+ word.set_width(FRAME_X_RADIUS)
word.rotate(-45*DEGREES)
self.play(Write(word))
self.wait()
@@ -3855,7 +3855,7 @@ class ThinkBackToHowAmazingThisIs(ThreeDScene):
)
def update_decimal(decimal):
z = self.camera.rotation_mobject.get_center()[2]
- decimal.scale_to_fit_height(0.07*z)
+ decimal.set_height(0.07*z)
decimal.move_to(0.7*z*UP)
scale_decimal = ContinualUpdateFromFunc(decimal, update_decimal)
@@ -4427,7 +4427,7 @@ class Promotion(PiCreatureScene):
url.to_corner(UP+LEFT)
rect = Rectangle(height = 9, width = 16)
- rect.scale_to_fit_height(5.5)
+ rect.set_height(5.5)
rect.next_to(url, DOWN)
rect.to_edge(LEFT)
diff --git a/old_projects/bell.py b/old_projects/bell.py
index 2138e1e28..9e710b16b 100644
--- a/old_projects/bell.py
+++ b/old_projects/bell.py
@@ -1473,7 +1473,7 @@ class VennDiagramProofByContradiction(Scene):
#Split to hundred
photons = VGroup(*[photon.deepcopy() for x in range(100)])
self.arrange_photons_in_circle(photons)
- photons.scale_to_fit_height(6)
+ photons.set_height(6)
photons.next_to(words, DOWN)
photons.to_edge(LEFT)
@@ -1555,7 +1555,7 @@ class VennDiagramProofByContradiction(Scene):
MoveToTarget(A),
MoveToTarget(A.label),
FadeOut(self.photon_words),
- self.photons.scale_to_fit_height,
+ self.photons.set_height,
0.85*A.target.get_height(),
self.photons.space_out_submobjects, 0.8,
self.photons.move_to, A.target,
@@ -2016,7 +2016,7 @@ class VennDiagramProofByContradiction(Scene):
for i in range(len(photons) - len(pairs)):
pairs.append(rejected.pop())
for photon, (x, y) in zip(photons, pairs):
- photon.scale_to_fit_width(0.7)
+ photon.set_width(0.7)
photon.move_to(x*RIGHT + y*UP)
return photons
diff --git a/old_projects/borsuk.py b/old_projects/borsuk.py
index 550ffb396..729409d69 100644
--- a/old_projects/borsuk.py
+++ b/old_projects/borsuk.py
@@ -18,7 +18,7 @@ class Jewel(VMobject):
compass_vects.reverse()
for vect_pair in adjacent_pairs(compass_vects):
self.add(Polygon(vect, *vect_pair))
- self.scale_to_fit_height(self.height)
+ self.set_height(self.height)
self.rotate(-np.pi/2-np.pi/24, RIGHT)
self.rotate(-np.pi/12, UP)
self.submobjects.sort(lambda m1, m2 : cmp(-m1.get_center()[2], -m2.get_center()[2]))
@@ -51,7 +51,7 @@ class Necklace(VMobject):
for color in self.colors
])
jewels.arrange_submobjects(buff = self.jewel_buff)
- jewels.scale_to_fit_width(self.width)
+ jewels.set_width(self.width)
jewels.center()
j_to_j_dist = (jewels[1].get_center()-jewels[0].get_center())[0]
@@ -69,7 +69,7 @@ class Necklace(VMobject):
class FromPreviousTopologyVideo(Scene):
def construct(self):
rect = Rectangle(height = 9, width = 16)
- rect.scale_to_fit_height(FRAME_HEIGHT-2)
+ rect.set_height(FRAME_HEIGHT-2)
title = TextMobject("From original ``Who cares about topology'' video")
title.to_edge(UP)
rect.next_to(title, DOWN)
@@ -92,7 +92,7 @@ class CheckOutMathologer(PiCreatureScene):
name.next_to(logo, RIGHT)
rect = Rectangle(height = 9, width = 16)
- rect.scale_to_fit_height(self.screen_height)
+ rect.set_height(self.screen_height)
rect.next_to(logo, DOWN)
rect.to_edge(LEFT)
@@ -110,7 +110,7 @@ class CheckOutMathologer(PiCreatureScene):
def get_logo(self):
logo = ImageMobject(self.logo_file)
- logo.scale_to_fit_height(self.logo_height)
+ logo.set_height(self.logo_height)
logo.to_corner(UP+LEFT)
if self.logo_color is not None:
logo.set_color(self.logo_color)
@@ -245,7 +245,7 @@ class IntroduceStolenNecklaceProblem(ThreeDScene):
half_label.arrange_submobjects()
half_labels.add(half_label)
half_labels.arrange_submobjects(DOWN)
- half_labels.scale_to_fit_height(thief.get_height())
+ half_labels.set_height(thief.get_height())
half_labels.next_to(
thief, vect,
buff = MED_LARGE_BUFF,
@@ -578,7 +578,7 @@ class WriteWords(Scene):
def construct(self):
words = TextMobject(self.words)
words.set_color(self.color)
- words.scale_to_fit_width(FRAME_WIDTH-1)
+ words.set_width(FRAME_WIDTH-1)
words.to_edge(DOWN)
self.play(Write(words))
self.wait(2)
@@ -711,7 +711,7 @@ class PointOutVSauce(CheckOutMathologer):
}
def get_logo(self):
logo = SVGMobject(file_name = self.logo_file)
- logo.scale_to_fit_height(self.logo_height)
+ logo.set_height(self.logo_height)
logo.to_corner(UP+LEFT)
logo.set_stroke(width = 0)
logo.set_fill(GREEN)
@@ -1290,7 +1290,7 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem):
for jewel_type in jewel_types:
num_mob = TexMobject(str(len(jewel_type)))
jewel_copy = jewel_type[0].copy()
- # jewel_copy.scale_to_fit_height(num_mob.get_height())
+ # jewel_copy.set_height(num_mob.get_height())
jewel_copy.next_to(num_mob)
label = VGroup(num_mob, jewel_copy)
enumeration_labels.add(label)
@@ -1955,7 +1955,7 @@ class ChoicesForSpherePoint(GeneralizeBorsukUlam):
buff = LARGE_BUFF,
aligned_edge = LEFT
)
- choices.scale_to_fit_height(FRAME_Y_RADIUS)
+ choices.set_height(FRAME_Y_RADIUS)
choices.to_edge(LEFT)
choices.shift(DOWN)
@@ -2292,7 +2292,7 @@ class ShowFunctionDiagram(TotalLengthOfEachJewelEquals, ReconfigurableScene):
def add_necklace(self):
random.seed(self.random_seed)
ChoicesInNecklaceCutting.add_necklace(self)
- self.necklace.scale_to_fit_width(FRAME_X_RADIUS-1)
+ self.necklace.set_width(FRAME_X_RADIUS-1)
self.necklace.to_edge(UP, buff = LARGE_BUFF)
self.necklace.to_edge(LEFT, buff = SMALL_BUFF)
self.add(self.necklace)
@@ -2311,7 +2311,7 @@ class ShowFunctionDiagram(TotalLengthOfEachJewelEquals, ReconfigurableScene):
VGroup(*plane_class.get_top_level_mobjects())
for plane_class in plane_classes
])
- planes.scale_to_fit_width(FRAME_X_RADIUS)
+ planes.set_width(FRAME_X_RADIUS)
planes.to_edge(RIGHT)
self.example_coords = plane_classes[0].example_coords[0]
@@ -2407,7 +2407,7 @@ class JewelPairPlane(GraphScene):
class WhatThisMappingActuallyLooksLikeWords(Scene):
def construct(self):
words = TextMobject("What this mapping actually looks like")
- words.scale_to_fit_width(FRAME_WIDTH-1)
+ words.set_width(FRAME_WIDTH-1)
words.to_edge(DOWN)
self.play(Write(words))
@@ -2578,7 +2578,7 @@ class MortyLookingAtRectangle(Scene):
url.scale(0.75)
url.to_corner(UP+LEFT)
rect = Rectangle(height = 9, width = 16)
- rect.scale_to_fit_height(5)
+ rect.set_height(5)
rect.next_to(url, DOWN)
rect.shift_onto_screen()
url.save_state()
@@ -2639,7 +2639,7 @@ class Test(Scene):
# necklace.apply_function(
# lambda (x, y, z) : x*RIGHT + (y + 0.1*x**2)*UP
# )
- necklace.scale_to_fit_width(randy.get_width() + 1)
+ necklace.set_width(randy.get_width() + 1)
necklace.move_to(randy)
self.add(randy, necklace)
diff --git a/old_projects/brachistochrone/cycloid.py b/old_projects/brachistochrone/cycloid.py
index b20e2840d..0e0a3cef5 100644
--- a/old_projects/brachistochrone/cycloid.py
+++ b/old_projects/brachistochrone/cycloid.py
@@ -377,7 +377,7 @@ class LeviSolution(CycloidScene):
]
for line, tex, scale in triplets:
trig_mob = TexMobject(tex)
- trig_mob.scale_to_fit_width(
+ trig_mob.set_width(
scale*line.get_length()
)
trig_mob.shift(-1.2*trig_mob.get_top())
@@ -529,7 +529,7 @@ class SlidingObject(CycloidScene, PathSlidingScene):
words1.next_to(arrow, LEFT)
words2.next_to(arrow, RIGHT)
words = Mobject(words1, arrow, words2)
- words.scale_to_fit_width(FRAME_WIDTH-1)
+ words.set_width(FRAME_WIDTH-1)
words.to_edge(UP, buff = 0.2)
words.to_edge(LEFT)
diff --git a/old_projects/brachistochrone/drawing_images.py b/old_projects/brachistochrone/drawing_images.py
index ab6d457d4..267839428 100644
--- a/old_projects/brachistochrone/drawing_images.py
+++ b/old_projects/brachistochrone/drawing_images.py
@@ -316,7 +316,7 @@ class MathematiciansOfEurope(Scene):
name_mob = TextMobject(name.replace("_", " "))
name_mob.to_corner(UP+LEFT, buff=0.75)
self.add(name_mob)
- man.scale_to_fit_height(4)
+ man.set_height(4)
mobject = Point(man.get_corner(UP+LEFT))
self.play(Transform(mobject, man))
man.scale(0.2)
@@ -358,10 +358,10 @@ class NewtonConsideredEveryoneBeneathHim(Scene):
newton = mathematicians.pop(0)
newton.scale(0.8)
new_newton = newton.copy()
- new_newton.scale_to_fit_height(3)
+ new_newton.set_height(3)
new_newton.to_edge(UP)
for man in mathematicians:
- man.scale_to_fit_width(1.7)
+ man.set_width(1.7)
johann = mathematicians.pop(0)
johann.next_to(new_newton, DOWN)
last_left, last_right = johann, johann
diff --git a/old_projects/brachistochrone/misc.py b/old_projects/brachistochrone/misc.py
index 69f60022c..06afcdacf 100644
--- a/old_projects/brachistochrone/misc.py
+++ b/old_projects/brachistochrone/misc.py
@@ -91,7 +91,7 @@ class TimeLine(Scene):
run_time = next(run_times)
))
picture = ImageMobject(event["picture"], invert = False)
- picture.scale_to_fit_width(2)
+ picture.set_width(2)
picture.to_corner(UP+RIGHT)
event_mob = TextMobject(event["text"])
event_mob.shift(2*LEFT+2*UP)
@@ -131,7 +131,7 @@ class StayedUpAllNight(Scene):
)
solution.stroke_width = 3
solution.set_color(GREY)
- solution.scale_to_fit_width(5)
+ solution.set_width(5)
solution.to_corner(UP+RIGHT)
newton = ImageMobject("Old_Newton", invert = False)
newton.scale(0.8)
@@ -139,13 +139,13 @@ class StayedUpAllNight(Scene):
rect = Rectangle(height = 6, width = 4.5, color = WHITE)
rect.to_corner(UP+RIGHT)
rect.shift(DOWN)
- phil_trans.scale_to_fit_width(0.8*rect.get_width())
+ phil_trans.set_width(0.8*rect.get_width())
phil_trans.next_to(Point(rect.get_top()), DOWN)
new_solution = solution.copy()
- new_solution.scale_to_fit_width(phil_trans.get_width())
+ new_solution.set_width(phil_trans.get_width())
new_solution.next_to(phil_trans, DOWN, buff = 1)
not_newton = TextMobject("-Totally not by Newton")
- not_newton.scale_to_fit_width(2.5)
+ not_newton.set_width(2.5)
not_newton.next_to(new_solution, DOWN, aligned_edge = RIGHT)
phil_trans.add(rect)
@@ -471,7 +471,7 @@ class YetAnotherMarkLevi(Scene):
words = TextMobject("Yet another bit of Mark Levi cleverness")
words.to_edge(UP)
levi = ImageMobject("Mark_Levi", invert = False)
- levi.scale_to_fit_width(6)
+ levi.set_width(6)
levi.show()
self.add(levi)
diff --git a/old_projects/complex_multiplication_article.py b/old_projects/complex_multiplication_article.py
index 979b3176e..04f9d89ac 100644
--- a/old_projects/complex_multiplication_article.py
+++ b/old_projects/complex_multiplication_article.py
@@ -194,7 +194,7 @@ class DrawComplexAngleAndMagnitude(Scene):
label = TexMobject(tex_representation)
max_width = 0.8*self.plane.unit_to_spatial_width
if label.get_width() > max_width:
- label.scale_to_fit_width(max_width)
+ label.set_width(max_width)
dot_to_label_dir = RIGHT if point[0] > 0 else LEFT
edge = label.get_edge_center(-dot_to_label_dir)
buff = 0.1
@@ -233,7 +233,7 @@ class DrawComplexAngleAndMagnitude(Scene):
# tex_parts = tex_representation.split("-")
# x_label, y_label = map(TexMobject, tex_parts)
# for label in x_label, y_label:
- # label.scale_to_fit_height(0.5)
+ # label.set_height(0.5)
# x_label.next_to(x_line, point[1]*DOWN/abs(point[1]))
# y_label.next_to(y_line, point[0]*RIGHT/abs(point[0]))
norm = np.linalg.norm(point)
diff --git a/old_projects/crypto.py b/old_projects/crypto.py
index cd02440ea..e1ca76b43 100644
--- a/old_projects/crypto.py
+++ b/old_projects/crypto.py
@@ -79,7 +79,7 @@ class TenDollarBill(VGroup):
fill_color = BLACK,
fill_opacity = 1,
)
- rect.scale_to_fit_height(self.height)
+ rect.set_height(self.height)
oval = Circle()
oval.stretch_to_fit_height(0.7*self.height)
oval.stretch_to_fit_width(0.4*self.height)
@@ -89,14 +89,14 @@ class TenDollarBill(VGroup):
mode = "pondering",
color = GREEN_B
)
- pi.scale_to_fit_width(oval.get_width())
+ pi.set_width(oval.get_width())
pi.move_to(oval)
pi.shift(0.1*pi.get_height()*DOWN)
self.add(pi, rect)
for vect in UP+LEFT, DOWN+RIGHT:
ten = TexMobject("\\$10")
- ten.scale_to_fit_height(0.25*self.height)
+ ten.set_height(0.25*self.height)
ten.next_to(self.get_corner(vect), -vect, SMALL_BUFF)
ten.set_color(GREEN_C)
self.add(ten)
@@ -211,7 +211,7 @@ class DisectQuestion(TeacherStudentsScene):
"Proof of work, ",
"Cryptographic hash functions, \\dots"
)
- topics.scale_to_fit_width(FRAME_WIDTH - LARGE_BUFF)
+ topics.set_width(FRAME_WIDTH - LARGE_BUFF)
topics.to_edge(UP)
topics.set_color_by_tex("Digital", BLUE)
topics.set_color_by_tex("Proof", GREEN)
@@ -253,7 +253,7 @@ class CryptocurrencyEquation(Scene):
"= Cryptocurrency"
)
VGroup(*parts[-1][1:]).set_color(YELLOW)
- parts.scale_to_fit_width(FRAME_WIDTH - LARGE_BUFF)
+ parts.set_width(FRAME_WIDTH - LARGE_BUFF)
for part in parts:
self.play(FadeIn(part))
@@ -277,7 +277,7 @@ class ListRecentCurrencies(Scene):
EthereumLogo().set_color_by_gradient(GREEN_B, GREEN_D),
)
for logo in logos:
- logo.scale_to_fit_height(0.75)
+ logo.set_height(0.75)
logos.arrange_submobjects(DOWN, buff = MED_LARGE_BUFF)
logos.shift(LEFT)
logos.to_edge(UP)
@@ -349,7 +349,7 @@ class NoCommentOnSpeculation(TeacherStudentsScene):
cross = Cross(group)
mining_graphic = ImageMobject("bitcoin_mining_graphic")
- mining_graphic.scale_to_fit_height(2)
+ mining_graphic.set_height(2)
mining_graphic.next_to(self.teacher, UP+LEFT)
mining_cross = Cross(mining_graphic)
mining_cross.set_stroke(RED, 8)
@@ -444,7 +444,7 @@ class LedgerScene(PiCreatureScene):
items = self.ledger.content
- mob.scale_to_fit_height(self.ledger_line_height)
+ mob.set_height(self.ledger_line_height)
if self.enumerate_lines:
num = TexMobject(str(len(items)) + ".")
num.scale(0.8)
@@ -671,7 +671,7 @@ class UnderlyingSystemVsUserFacing(Scene):
btc = BitcoinLogo()
btc.next_to(phone, UP, MED_LARGE_BUFF)
dollar = TexMobject("\\$")
- dollar.scale_to_fit_height(1)
+ dollar.set_height(1)
dollar.set_color(GREEN)
dollar.next_to(card, UP, MED_LARGE_BUFF)
card.save_state()
@@ -729,7 +729,7 @@ class IntroduceLedgerSystem(LedgerScene):
from_pi = getattr(self, from_name.lower())
to_pi = getattr(self, to_name.lower())
cash = TexMobject("\\$"*(num/10)).set_color(GREEN)
- cash.scale_to_fit_height(0.5)
+ cash.set_height(0.5)
cash.move_to(from_pi)
self.play(
cash.move_to, to_pi,
@@ -1658,7 +1658,7 @@ class LedgerWithInitialBuyIn(SignedLedgerScene):
self.add_line_to_ledger(new_line)
lines.add(new_line)
line = Line(LEFT, RIGHT)
- line.scale_to_fit_width(self.ledger.get_width())
+ line.set_width(self.ledger.get_width())
line.scale_in_place(0.9)
line.next_to(lines[-1], DOWN, SMALL_BUFF, LEFT)
line.set_stroke(width = 1)
@@ -1769,7 +1769,7 @@ class RemovedConnectionBetweenLedgerAndCash(TeacherStudentsScene):
color = WHITE
)
ledger_name = TextMobject("Ledger")
- ledger_name.scale_to_fit_width(ledger.get_width() - MED_SMALL_BUFF)
+ ledger_name.set_width(ledger.get_width() - MED_SMALL_BUFF)
ledger_name.next_to(ledger.get_top(), DOWN)
ledger.add(ledger_name)
@@ -2002,7 +2002,7 @@ class BitcoinIsALedger(Scene):
def get_ledger(self):
rect = Rectangle(height = 2, width = 1.5)
title = TextMobject("Ledger")
- title.scale_to_fit_width(0.8*rect.get_width())
+ title.set_width(0.8*rect.get_width())
title.next_to(rect.get_top(), DOWN, SMALL_BUFF)
lines = VGroup(*[
@@ -2023,7 +2023,7 @@ class BigDifferenceBetweenLDAndCryptocurrencies(Scene):
logos = VGroup(ltc, eth, ld, btc)
cryptos = VGroup(btc, eth, ltc)
for logo in cryptos:
- logo.scale_to_fit_height(1)
+ logo.set_height(1)
vects = compass_directions(4, DOWN+LEFT)
for logo, vect in zip(logos, vects):
logo.move_to(0.75*vect)
@@ -2048,7 +2048,7 @@ class BigDifferenceBetweenLDAndCryptocurrencies(Scene):
class DistributedLedgerScene(LedgerScene):
def get_large_network(self):
network = self.get_network()
- network.scale_to_fit_height(FRAME_HEIGHT - LARGE_BUFF)
+ network.set_height(FRAME_HEIGHT - LARGE_BUFF)
network.center()
for pi in self.pi_creatures:
pi.label.scale(0.8, about_point = pi.get_bottom())
@@ -2058,7 +2058,7 @@ class DistributedLedgerScene(LedgerScene):
ledger = self.get_ledger()
title = ledger[1]
h_line = ledger.content
- title.scale_to_fit_width(0.7*ledger.get_width())
+ title.set_width(0.7*ledger.get_width())
title.next_to(ledger.get_top(), DOWN, MED_LARGE_BUFF)
h_line.next_to(title, DOWN)
added_lines = VGroup(*[h_line.copy() for x in range(5)])
@@ -2069,7 +2069,7 @@ class DistributedLedgerScene(LedgerScene):
ledgers = VGroup()
for pi in self.pi_creatures:
pi.ledger = ledger.copy()
- pi.ledger.scale_to_fit_height(pi.get_height())
+ pi.ledger.set_height(pi.get_height())
pi.ledger[0].set_color(pi.get_color())
vect = pi.get_center()-self.pi_creatures.get_center()
x_vect = vect[0]*RIGHT
@@ -2158,7 +2158,7 @@ class TransitionToDistributedLedger(DistributedLedgerScene):
for pi in self.pi_creatures
])
self.play(
- group.scale_to_fit_height, FRAME_HEIGHT - 2,
+ group.set_height, FRAME_HEIGHT - 2,
group.center
)
self.wait(2)
@@ -2853,7 +2853,7 @@ class IntroduceNonceOnTrasactions(LedgerScene):
def change_ledger(self):
amount = self.ledger.content[2][-1]
new_amount = TextMobject("300 LD")
- new_amount.scale_to_fit_height(amount.get_height())
+ new_amount.set_height(amount.get_height())
new_amount.set_color(amount.get_color())
new_amount.move_to(amount, LEFT)
@@ -3104,7 +3104,7 @@ class IntroduceBlockChain(Scene):
blocks = self.blocks
amount = blocks[0].payments[1][3]
new_amount = TextMobject("400 LD")
- new_amount.scale_to_fit_height(amount.get_height())
+ new_amount.set_height(amount.get_height())
new_amount.set_color(RED)
new_amount.move_to(amount, LEFT)
@@ -3143,7 +3143,7 @@ class IntroduceBlockChain(Scene):
for x in range(50)
])
num_pow_group.set_color(proof_of_work.get_color())
- num_pow_group.scale_to_fit_width(proof_of_work.get_width())
+ num_pow_group.set_width(proof_of_work.get_width())
num_pow_group.move_to(proof_of_work)
for num_pow in num_pow_group:
self.add(num_pow)
@@ -3207,7 +3207,7 @@ class IntroduceBlockChain(Scene):
payment.add(signature)
factor = self.payment_height_to_block_height
- payment.scale_to_fit_height(factor*rect.get_height())
+ payment.set_height(factor*rect.get_height())
payments.add(payment)
self.transaction_counter += 1
payments.add(TexMobject("\\dots").scale(0.5))
@@ -3271,7 +3271,7 @@ class DistributedBlockChainScene(DistributedLedgerScene):
preserve_tip_size_when_scaling = False,
tip_length = 0.15,
)
- arrow.scale_to_fit_width(b1.get_width())
+ arrow.set_width(b1.get_width())
target_point = interpolate(
b2.get_left(), b2.get_corner(UP+LEFT), 0.8
)
@@ -3434,7 +3434,7 @@ class IntroduceBlockCreator(DistributedBlockChainScene):
everything = VGroup()
for x in range(self.n_block_creators):
block_creator = PiCreature(color = GREY)
- block_creator.scale_to_fit_height(self.alice.get_height())
+ block_creator.set_height(self.alice.get_height())
label = TextMobject("Block creator %d"%(x+1))
label.scale(0.7)
label.next_to(block_creator, DOWN, SMALL_BUFF)
@@ -3512,12 +3512,12 @@ class IntroduceBlockCreator(DistributedBlockChainScene):
payments = self.payments
payments.generate_target()
- payments.target.scale_to_fit_height(1.5)
+ payments.target.set_height(1.5)
payments.target.move_to(block)
prev_hash = TextMobject("Prev hash")
prev_hash.set_color(BLUE)
- prev_hash.scale_to_fit_height(0.3)
+ prev_hash.set_height(0.3)
prev_hash.next_to(block.get_top(), DOWN, MED_SMALL_BUFF)
block.add(prev_hash)
@@ -3545,7 +3545,7 @@ class IntroduceBlockCreator(DistributedBlockChainScene):
for x in range(self.n_pow_guesses):
guess = Integer(random.randint(10**11, 10**12))
guess.set_color(GREEN)
- guess.scale_to_fit_height(0.3)
+ guess.set_height(0.3)
guess.next_to(block.get_bottom(), UP, MED_SMALL_BUFF)
if x == self.n_pow_guesses - 1:
@@ -3553,7 +3553,7 @@ class IntroduceBlockCreator(DistributedBlockChainScene):
VGroup(*digest[:60]).set_color(YELLOW)
else:
digest = sha256_tex_mob(str(x))
- digest.scale_to_fit_width(block.get_width())
+ digest.set_width(block.get_width())
digest.next_to(arrow.get_end(), DOWN)
self.add(guess, digest)
@@ -3574,7 +3574,7 @@ class IntroduceBlockCreator(DistributedBlockChainScene):
)
new_transaction[0].set_color(LIGHT_GREY)
new_transaction.set_color_by_tex("LD", YELLOW)
- new_transaction.scale_to_fit_height(payments[0].get_height())
+ new_transaction.set_height(payments[0].get_height())
new_transaction.move_to(payments.get_top())
payments.generate_target()
payments.target.next_to(new_transaction, DOWN, SMALL_BUFF, LEFT)
@@ -3625,7 +3625,7 @@ class IntroduceBlockCreator(DistributedBlockChainScene):
new_top_payment = TextMobject("Miner 1", "gets", "10 LD")
new_top_payment[0].set_color(LIGHT_GREY)
new_top_payment[-1].set_color(YELLOW)
- new_top_payment.scale_to_fit_height(top_payment.get_height())
+ new_top_payment.set_height(top_payment.get_height())
new_top_payment.move_to(top_payment, LEFT)
self.play(Transform(top_payment, new_top_payment))
self.wait()
@@ -3713,13 +3713,13 @@ class MiningIsALottery(IntroduceBlockCreator):
block.next_to(miner, RIGHT)
payments = self.get_payments(miner)
- payments.scale_to_fit_height(1)
+ payments.set_height(1)
payments.move_to(block)
block.add(payments)
prev_hash = TextMobject("Prev hash")
prev_hash.set_color(BLUE)
- prev_hash.scale_to_fit_height(0.2)
+ prev_hash.set_height(0.2)
prev_hash.next_to(block.get_top(), DOWN, SMALL_BUFF)
block.add(prev_hash)
@@ -3749,11 +3749,11 @@ class MiningIsALottery(IntroduceBlockCreator):
digests = VGroup()
for block in self.blocks:
nonce = Integer(random.randint(10**e, 10**(e+1)))
- nonce.scale_to_fit_height(0.2)
+ nonce.set_height(0.2)
nonce.next_to(block.get_bottom(), UP, SMALL_BUFF)
nonces.add(nonce)
digest = sha256_tex_mob(str(x) + str(block))
- digest.scale_to_fit_height(block.get_height())
+ digest.set_height(block.get_height())
digest.next_to(block.arrow, RIGHT)
digests.add(digest)
self.add(nonces, digests)
@@ -3814,7 +3814,7 @@ class MiningIsALottery(IntroduceBlockCreator):
lines.add(self.add_payment_line_to_ledger(*payment))
lines.add(TexMobject("\\vdots"))
for line in lines:
- line.scale_to_fit_height(0.5)
+ line.set_height(0.5)
lines.arrange_submobjects(
DOWN, buff = SMALL_BUFF, aligned_edge = LEFT
)
@@ -4092,7 +4092,7 @@ class DoubleSpendingAttack(DistributedBlockChainScene):
def get_fraud_block(self):
block = self.get_block()
- block.scale_to_fit_height(self.fraud_block_height)
+ block.set_height(self.fraud_block_height)
content = VGroup()
tuples = [
@@ -4102,7 +4102,7 @@ class DoubleSpendingAttack(DistributedBlockChainScene):
for word, vect, color in tuples:
mob = TextMobject(word)
mob.set_color(color)
- mob.scale_to_fit_height(0.07*block.get_height())
+ mob.set_height(0.07*block.get_height())
mob.next_to(
block.get_edge_center(vect), -vect,
buff = 0.06*block.get_height()
@@ -4121,7 +4121,7 @@ class DoubleSpendingAttack(DistributedBlockChainScene):
TexMobject("\\vdots")
)
payments.arrange_submobjects(DOWN)
- payments.scale_to_fit_width(0.9*block.get_width())
+ payments.set_width(0.9*block.get_width())
payments.move_to(block)
content.add(payments)
@@ -4173,7 +4173,7 @@ class AliceRacesOtherMiners(DoubleSpendingAttack):
PiCreature(color = GREY)
for x in range(self.n_miners)
])
- miners.scale_to_fit_height(alice.get_height())
+ miners.set_height(alice.get_height())
miners.arrange_submobjects(RIGHT, buff = LARGE_BUFF)
miners.to_edge(DOWN+LEFT)
miners.shift(0.5*UP)
@@ -4187,7 +4187,7 @@ class AliceRacesOtherMiners(DoubleSpendingAttack):
self.add_foreground_mobject(self.proofs_of_work)
for miner in miners:
block = self.get_block()
- block.scale_to_fit_width(1.5*miner.get_width())
+ block.set_width(1.5*miner.get_width())
block.next_to(miner, UP)
transactions = self.get_block_filler(block)
@@ -4196,7 +4196,7 @@ class AliceRacesOtherMiners(DoubleSpendingAttack):
proof_of_work = self.get_rand_int_mob()
prev_hash = TextMobject("Prev hash").set_color(BLUE)
for mob, vect in (proof_of_work, DOWN), (prev_hash, UP):
- mob.scale_to_fit_height(0.1*block.get_height())
+ mob.set_height(0.1*block.get_height())
mob.next_to(
block.get_edge_center(vect), -vect,
buff = 0.05*block.get_height()
@@ -4376,7 +4376,7 @@ class AliceRacesOtherMiners(DoubleSpendingAttack):
def get_block_filler(self, block):
result = TextMobject("$\\langle$Transactions$\\rangle$")
- result.scale_to_fit_width(0.8*block.get_width())
+ result.set_width(0.8*block.get_width())
result.move_to(block)
return result
@@ -4430,7 +4430,7 @@ class WhenToTrustANewBlock(DistributedBlockChainScene):
for word, vect, color in tuples:
mob = TextMobject(word)
mob.set_color(color)
- mob.scale_to_fit_height(0.07*block.get_height())
+ mob.set_height(0.07*block.get_height())
mob.next_to(
block.get_edge_center(vect), -vect,
buff = 0.06*block.get_height()
@@ -4439,7 +4439,7 @@ class WhenToTrustANewBlock(DistributedBlockChainScene):
attr = word.lower().replace(" ", "_")
setattr(block, attr, mob)
transactions = TextMobject("$\\langle$Transactions$\\rangle$")
- transactions.scale_to_fit_width(0.8*block.get_width())
+ transactions.set_width(0.8*block.get_width())
transactions.move_to(block)
block.add(transactions)
return block
@@ -4476,7 +4476,7 @@ class MainIdeas(Scene):
title = TextMobject("Main ideas")
title.scale(1.5)
h_line = Line(LEFT, RIGHT)
- h_line.scale_to_fit_width(FRAME_X_RADIUS)
+ h_line.set_width(FRAME_X_RADIUS)
h_line.next_to(title, DOWN)
VGroup(title, h_line).to_corner(UP+LEFT)
@@ -4596,7 +4596,7 @@ class VariableProofOfWork(WhenToTrustANewBlock):
])
everyone = VGroup(target, *copies)
everyone.arrange_submobjects(DOWN)
- everyone.scale_to_fit_height(FRAME_HEIGHT - LARGE_BUFF)
+ everyone.set_height(FRAME_HEIGHT - LARGE_BUFF)
everyone.to_corner(UP+LEFT)
self.play(Transform(miner_block, target))
@@ -4639,7 +4639,7 @@ class CompareBlockTimes(Scene):
title.scale(1.5)
title.to_edge(UP)
h_line = Line(LEFT, RIGHT)
- h_line.scale_to_fit_width(FRAME_X_RADIUS)
+ h_line.set_width(FRAME_X_RADIUS)
h_line.next_to(title, DOWN, SMALL_BUFF)
examples = VGroup(
@@ -4662,7 +4662,7 @@ class CompareBlockTimes(Scene):
)
colors = [BITCOIN_COLOR, GREEN, BLUE_B, LIGHT_GREY]
for logo, example, color in zip(logos, examples, colors):
- logo.scale_to_fit_height(0.5)
+ logo.set_height(0.5)
logo.next_to(example, LEFT)
example[0].set_color(color)
@@ -4686,7 +4686,7 @@ class CompareBlockTimes(Scene):
# logo.set_fill(GREEN, 1)
# logo.set_stroke(WHITE, 3)
# logo.set_color_by_gradient(GREEN_B, GREEN_D)
- # logo.scale_to_fit_width(1)
+ # logo.set_width(1)
# logo.center()
# self.add(SurroundingRectangle(logo))
# return logo
@@ -4696,12 +4696,12 @@ class BlockRewards(Scene):
title = TextMobject("Block rewards")
title.scale(1.5)
logo = BitcoinLogo()
- logo.scale_to_fit_height(0.75)
+ logo.set_height(0.75)
logo.next_to(title, LEFT)
title.add(logo)
title.to_edge(UP)
h_line = Line(LEFT, RIGHT)
- h_line.scale_to_fit_width(FRAME_X_RADIUS)
+ h_line.set_width(FRAME_X_RADIUS)
h_line.next_to(title, DOWN)
self.add(title, logo, h_line)
@@ -5009,7 +5009,7 @@ class ShowManyExchanges(Scene):
cryptocurrencies = self.get_cryptocurrencies()
currencies = self.get_currencies()
for currency in it.chain(currencies, cryptocurrencies):
- currency.scale_to_fit_height(0.5)
+ currency.set_height(0.5)
currency.align_data(EthereumLogo())
exchange = VGroup(*[
Arrow(
@@ -5177,7 +5177,7 @@ class ProtocolLabs(PiCreatureScene):
logo.next_to(morty, UP)
logo.shift_onto_screen()
screen_rect = ScreenRectangle()
- screen_rect.scale_to_fit_height(5)
+ screen_rect.set_height(5)
screen_rect.to_edge(LEFT)
self.play(
@@ -5231,7 +5231,7 @@ class Thumbnail(DistributedBlockChainScene):
# BitcoinLogo(), EthereumLogo(), LitecoinLogo()
# )
# for logo in logos:
- # logo.scale_to_fit_height(1)
+ # logo.set_height(1)
# logos.add(TexMobject("\\dots").scale(2))
# logos.arrange_submobjects(RIGHT)
# logos.next_to(title, RIGHT, LARGE_BUFF)
@@ -5240,7 +5240,7 @@ class Thumbnail(DistributedBlockChainScene):
block_chain = self.get_block_chain()
block_chain.arrows.set_color(RED)
block_chain.blocks.set_color_by_gradient(BLUE, GREEN)
- block_chain.scale_to_fit_width(FRAME_WIDTH-1)
+ block_chain.set_width(FRAME_WIDTH-1)
block_chain.set_stroke(width = 12)
self.add(block_chain)
diff --git a/old_projects/dandelin.py b/old_projects/dandelin.py
index 302df8a8c..23242fe80 100644
--- a/old_projects/dandelin.py
+++ b/old_projects/dandelin.py
@@ -51,7 +51,7 @@ class ThinkingAboutAProof(PiCreatureScene):
bubble.shift(MED_SMALL_BUFF * RIGHT)
cloud = bubble[-1]
cloud.rotate(90 * DEGREES)
- cloud.scale_to_fit_height(FRAME_HEIGHT - 0.5)
+ cloud.set_height(FRAME_HEIGHT - 0.5)
cloud.stretch(2.8, 0)
cloud.next_to(bubble[0], RIGHT)
cloud.to_edge(UP, buff=0.25)
@@ -153,7 +153,7 @@ class SumOfIntegersProof(Scene):
row.arrange_submobjects(RIGHT, buff=0)
rows.add(row)
rows.arrange_submobjects(DOWN, buff=0, aligned_edge=LEFT)
- rows.scale_to_fit_height(5)
+ rows.set_height(5)
rows.set_stroke(WHITE, 3)
rows.set_fill(BLUE, 0.5)
return rows
@@ -407,13 +407,13 @@ class ShowArrayOfEccentricities(Scene):
))
self.play(
LaggedStart(FadeOutAndShiftDown, group),
- circle.scale_to_fit_height, 5,
+ circle.set_height, 5,
circle.center,
)
def get_ellipse(self, eccentricity, width=2):
result = Circle(color=WHITE)
- result.scale_to_fit_width(width)
+ result.set_width(width)
a = width / 2.0
c = eccentricity * a
b = np.sqrt(a**2 - c**2)
@@ -452,8 +452,8 @@ class ShowOrbits(ShowArrayOfEccentricities):
comet_eccentricity = 0.9671
earth_orbit = self.get_ellipse(eccentricity=earth_eccentricity)
comet_orbit = self.get_ellipse(eccentricity=comet_eccentricity)
- earth_orbit.scale_to_fit_height(5)
- comet_orbit.scale_to_fit_width(
+ earth_orbit.set_height(5)
+ comet_orbit.set_width(
0.7 * FRAME_WIDTH,
about_point=ORIGIN,
)
@@ -461,9 +461,9 @@ class ShowOrbits(ShowArrayOfEccentricities):
sun = ImageMobject("Sun")
earth = ImageMobject("Earth")
comet = ImageMobject("Comet")
- sun.scale_to_fit_height(1)
- earth.scale_to_fit_height(0.5)
- comet.scale_to_fit_height(0.1)
+ sun.set_height(1)
+ earth.set_height(0.5)
+ comet.set_height(0.1)
earth_parts = VGroup(sun, earth_orbit, earth)
@@ -497,7 +497,7 @@ class ShowOrbits(ShowArrayOfEccentricities):
orbiting_earth.rate = 1.5
orbiting_comet.rate = 1.5
self.play(
- earth_parts.scale_to_fit_height,
+ earth_parts.set_height,
comet_orbit.get_height() / 4.53,
earth_parts.shift, 3 * RIGHT
)
@@ -550,7 +550,7 @@ class EccentricityInThumbtackCase(ShowArrayOfEccentricities):
focus_distance.add_to_back(focus_distance.copy().set_stroke(BLACK, 5))
focus_distance_update = ContinualUpdateFromFunc(
focus_distance,
- lambda m: m.scale_to_fit_width(
+ lambda m: m.set_width(
inner_brace_update.mobject.get_width(),
).next_to(inner_brace_update.mobject, DOWN, SMALL_BUFF)
)
@@ -569,7 +569,7 @@ class EccentricityInThumbtackCase(ShowArrayOfEccentricities):
fraction.to_edge(RIGHT, buff=MED_LARGE_BUFF)
numerator_update = ContinualUpdateFromFunc(
numerator,
- lambda m: m.scale_to_fit_width(focus_distance.get_width()).next_to(
+ lambda m: m.set_width(focus_distance.get_width()).next_to(
fraction[1], UP, MED_SMALL_BUFF
)
)
@@ -711,7 +711,7 @@ class EccentricityInThumbtackCase(ShowArrayOfEccentricities):
def get_thumbtack(self):
angle = 10 * DEGREES
result = SVGMobject(file_name="push_pin")
- result.scale_to_fit_height(0.5)
+ result.set_height(0.5)
result.set_fill(LIGHT_GREY)
result.rotate(angle)
return result
@@ -782,7 +782,7 @@ class AskWhyAreTheyTheSame(TeacherStudentsScene):
])
)
egg.flip()
- egg.scale_to_fit_width(3)
+ egg.set_width(3)
egg.set_stroke(RED, 5)
egg.move_to(bubble.get_bubble_center())
@@ -812,7 +812,7 @@ class TriangleOfEquivalences(Scene):
title = Title("How do you prove this\\textinterrobang.")
self.add(title)
rects = VGroup(*[ScreenRectangle() for x in range(3)])
- rects.scale_to_fit_height(2)
+ rects.set_height(2)
rects[:2].arrange_submobjects(RIGHT, buff=2)
rects[2].next_to(rects[:2], DOWN, buff=1.5)
rects.next_to(title, DOWN)
@@ -856,7 +856,7 @@ class ShowMeasurementBook(TeacherStudentsScene):
def construct(self):
measurement = ImageMobject("MeasurementCover")
- measurement.scale_to_fit_height(3.5)
+ measurement.set_height(3.5)
measurement.move_to(self.hold_up_spot, DOWN)
words = TextMobject("Highly recommended")
@@ -919,7 +919,7 @@ class AskAboutWhyYouWouldAddSpheres(PiCreatureScene):
def construct(self):
randy = self.pi_creature
randy.flip()
- randy.scale_to_fit_height(2)
+ randy.set_height(2)
randy.set_color(BLUE_C)
randy.to_edge(RIGHT)
randy.shift(2 * UP)
@@ -1001,7 +1001,7 @@ class ShowSegmentSplit(Scene):
def construct(self):
if self.include_image:
image = ImageMobject("ShowCircleToCircleLine")
- image.scale_to_fit_height(FRAME_HEIGHT)
+ image.set_height(FRAME_HEIGHT)
self.add(image)
brace1 = Brace(Line(ORIGIN, 1.05 * UP), LEFT)
@@ -1070,7 +1070,7 @@ class WriteConjecture(Scene):
def construct(self):
if self.include_image:
image = ImageMobject(self.image_name)
- image.scale_to_fit_height(FRAME_HEIGHT)
+ image.set_height(FRAME_HEIGHT)
self.add(image)
title = TextMobject("Conjecture:")
@@ -1253,11 +1253,11 @@ class NameDandelin(Scene):
title.to_edge(UP)
portrait = ImageMobject("GerminalDandelin")
- portrait.scale_to_fit_height(5)
+ portrait.set_height(5)
portrait.next_to(title, DOWN)
google_result = ImageMobject("GoogleDandelin")
- google_result.scale_to_fit_height(4)
+ google_result.set_height(4)
google_result.center()
google_result.to_corner(DR)
@@ -1362,14 +1362,14 @@ class CreativeConstruction(PiCreatureScene):
self.remove(randy)
dandelin = ImageMobject("GerminalDandelin")
- dandelin.scale_to_fit_height(4)
+ dandelin.set_height(4)
dandelin.move_to(FRAME_WIDTH * RIGHT / 4)
lightbulb = Lightbulb()
lightbulb.next_to(dandelin, UP)
kant = ImageMobject("Kant")
- kant.scale_to_fit_height(3)
+ kant.set_height(3)
bubble = ThoughtBubble(height=3, width=4)
bubble.pin_to(kant)
kant_words = TextMobject(
@@ -1412,7 +1412,7 @@ class CreativeConstruction(PiCreatureScene):
for submob in lightbulb.target.family_members_with_points():
if True or np.linalg.norm(submob.get_center() - lightbulb.get_center()) > 0.25:
q_mark = TexMobject("?")
- q_mark.scale_to_fit_height(0.25)
+ q_mark.set_height(0.25)
q_mark.move_to(submob)
Transform(submob, q_mark).update(1)
q_marks.add(submob)
@@ -1482,7 +1482,7 @@ class LockhartQuote(Scene):
},
alignment=""
)
- quote.scale_to_fit_width(FRAME_WIDTH - 2)
+ quote.set_width(FRAME_WIDTH - 2)
quote.to_edge(UP)
measurement = ImageMobject("MeasurementCover")
@@ -1490,12 +1490,12 @@ class LockhartQuote(Scene):
mona_lisa = ImageMobject("MonaLisa")
pictures = Group(measurement, madame_bovary, mona_lisa)
for picture in pictures:
- picture.scale_to_fit_height(4)
+ picture.set_height(4)
pictures.arrange_submobjects(RIGHT, buff=LARGE_BUFF)
pictures.to_edge(DOWN)
measurement.save_state()
- measurement.scale_to_fit_width(FRAME_WIDTH)
+ measurement.set_width(FRAME_WIDTH)
measurement.center()
measurement.fade(1)
self.play(Restore(measurement))
@@ -1553,7 +1553,7 @@ class ShowApollonianCircles(Scene):
for r, c in zip(radii, centers)
])
- circles.scale_to_fit_height(FRAME_HEIGHT - 3)
+ circles.set_height(FRAME_HEIGHT - 3)
circles.center().to_edge(DOWN)
# circles.set_fill(opacity=1)
circles.submobjects.reverse()
@@ -1605,7 +1605,7 @@ class EllipseLengthsLinedUp(EccentricityInThumbtackCase):
lines.set_stroke(width=5)
h_line = Line(LEFT, RIGHT, color=WHITE)
- h_line.scale_to_fit_width(0.25)
+ h_line.set_width(0.25)
def update_lines(lines):
for line, focus in zip(lines, foci):
diff --git a/old_projects/div_curl.py b/old_projects/div_curl.py
index 35146fd99..0ea11cc6b 100644
--- a/old_projects/div_curl.py
+++ b/old_projects/div_curl.py
@@ -210,7 +210,7 @@ def get_charged_particles(color, sign, radius=0.1):
)
sign = TexMobject(sign)
sign.set_stroke(WHITE, 1)
- sign.scale_to_fit_width(0.5 * result.get_width())
+ sign.set_width(0.5 * result.get_width())
sign.move_to(result)
result.add(sign)
return result
@@ -597,7 +597,7 @@ class ShowWritingTrajectory(TeacherStudentsScene):
prev_words.next_to(arrow, RIGHT)
screen.generate_target()
- screen.target.scale_to_fit_height(3.75)
+ screen.target.set_height(3.75)
screen.target.to_corner(UR)
complex_words = TextMobject("Complex derivatives")
complex_words.next_to(
@@ -1632,7 +1632,7 @@ class ThreeDVectorFieldEquation(Scene):
"xz",
"xy",
])
- vector.scale_to_fit_height(FRAME_HEIGHT - 1)
+ vector.set_height(FRAME_HEIGHT - 1)
self.add(vector)
@@ -1651,7 +1651,7 @@ class TotallyToScale(Scene):
words = TextMobject(
"Totally drawn to scale. \\\\ Don't even worry about it."
)
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
words.add_background_rectangle()
self.add(words)
self.wait()
@@ -2444,7 +2444,7 @@ class IntroduceCurl(IntroduceVectorField):
])
if clockwise:
result.flip()
- result.scale_to_fit_width(width)
+ result.set_width(width)
return result
@@ -2896,7 +2896,7 @@ class IllustrateGaussLaw(DefineDivergence, MovingCameraScene):
def zoom_in(self):
self.play(
- self.camera_frame.scale_to_fit_width, self.final_frame_width,
+ self.camera_frame.set_width, self.final_frame_width,
run_time=2
)
@@ -3019,7 +3019,7 @@ class ShowTwoPopulations(Scene):
fox, rabbit = examples = VGroup(foxes[0], rabbits[0])
for mob in examples:
mob.save_state()
- mob.scale_to_fit_height(3)
+ mob.set_height(3)
examples.arrange_submobjects(LEFT, buff=2)
preditor, prey = words = VGroup(
@@ -3209,7 +3209,7 @@ class PhaseSpaceOfPopulationModel(ShowTwoPopulations, PiCreatureScene, MovingCam
axes_labels = self.axes_labels = VGroup(*[
VGroup(
- method().scale_to_fit_height(0.75),
+ method().set_height(0.75),
TextMobject("Population"),
).arrange_submobjects(RIGHT, buff=MED_SMALL_BUFF)
for method in (self.get_rabbit, self.get_fox)
@@ -3308,7 +3308,7 @@ class PhaseSpaceOfPopulationModel(ShowTwoPopulations, PiCreatureScene, MovingCam
for char, animal in zip(variables, animals):
for part in equations.get_parts_by_tex(char):
animal_copy = animal.copy()
- animal_copy.scale_to_fit_height(0.5)
+ animal_copy.set_height(0.5)
animal_copy.move_to(part, DL)
Transform(part, animal_copy).update(1)
@@ -3719,7 +3719,7 @@ class NablaNotation(PiCreatureScene, MovingCameraScene):
self.add(screen_rect)
self.play(
- self.camera_frame.scale_to_fit_height, FRAME_HEIGHT + 3,
+ self.camera_frame.set_height, FRAME_HEIGHT + 3,
Write(words, rate_func=squish_rate_func(smooth, 0.3, 1)),
run_time=2,
)
@@ -3775,7 +3775,7 @@ class ShowDotProduct(MovingCameraScene):
include_background_rectangle=True,
)
- self.camera_frame.scale_to_fit_height(4)
+ self.camera_frame.set_height(4)
self.camera_frame.move_to(DL, DL)
self.add(plane)
self.add(dot_product, dot_product_value_update)
@@ -4594,7 +4594,7 @@ class ThoughtsOnAds(Scene):
vcb_group.to_edge(RIGHT)
knob = RegularPolygon(n=3, start_angle=-90 * DEGREES)
- knob.scale_to_fit_height(0.25)
+ knob.set_height(0.25)
knob.set_stroke(width=0)
knob.set_fill(YELLOW, 1)
knob.move_to(line.get_left(), DOWN)
diff --git a/old_projects/efvgt.py b/old_projects/efvgt.py
index 990aab1e2..aa28f10a2 100644
--- a/old_projects/efvgt.py
+++ b/old_projects/efvgt.py
@@ -197,7 +197,7 @@ class WatchingScreen(PiCreatureScene):
def construct(self):
screen = Rectangle(height = 9, width = 16)
- screen.scale_to_fit_height(self.screen_height)
+ screen.set_height(self.screen_height)
screen.to_corner(UP+RIGHT)
self.add(screen)
@@ -432,7 +432,7 @@ class SymmetriesOfSquare(ThreeDScene):
bottom_squares = VGroup(*all_squares[4:])
bottom_squares.next_to(top_squares, DOWN, buff = LARGE_BUFF)
- all_squares.scale_to_fit_width(FRAME_WIDTH-2*LARGE_BUFF)
+ all_squares.set_width(FRAME_WIDTH-2*LARGE_BUFF)
all_squares.center()
all_squares.to_edge(DOWN, buff = LARGE_BUFF)
@@ -592,7 +592,7 @@ class SymmetriesOfSquare(ThreeDScene):
def add_randy_to_square(self, square, mode = "pondering"):
randy = Randolph(mode = mode)
- randy.scale_to_fit_height(0.75*square.get_height())
+ randy.set_height(0.75*square.get_height())
randy.move_to(square)
square.add(randy)
square.randy = randy
@@ -642,7 +642,7 @@ class CircleSymmetries(Scene):
theta_group.next_to(arc_circle, UP)
def theta_value_update(theta_value, alpha):
new_theta_value = DecimalNumber(alpha*2*np.pi)
- new_theta_value.scale_to_fit_height(theta.get_height())
+ new_theta_value.set_height(theta.get_height())
new_theta_value.next_to(theta, RIGHT)
Transform(theta_value, new_theta_value).update(1)
return new_theta_value
@@ -1003,7 +1003,7 @@ class AddCubeSymmetries(GroupOfCubeSymmetries):
).add_tip()
for a in (0, np.pi)
])
- arrows.scale_to_fit_height(1.5*cube.get_height())
+ arrows.set_height(1.5*cube.get_height())
z_to_axis = z_to_vector(axis)
arrows.apply_function(
lambda p : np.dot(p, z_to_axis.T),
@@ -1097,7 +1097,7 @@ class DihedralGroupStructure(SymmetriesOfSquare):
"axis" : axis,
}
expression.arrange_submobjects()
- expression.scale_to_fit_width(FRAME_X_RADIUS+1)
+ expression.set_width(FRAME_X_RADIUS+1)
expression.to_edge(RIGHT, buff = SMALL_BUFF)
for square in s1, s2, s3:
square.remove(square.action_illustration)
@@ -1163,7 +1163,7 @@ class ThisIsAVeryGeneralIdea(Scene):
]))
numbers = examples[-1]
examples.arrange_submobjects(buff = LARGE_BUFF)
- examples.scale_to_fit_width(FRAME_WIDTH-1)
+ examples.set_width(FRAME_WIDTH-1)
examples.move_to(UP)
lines = VGroup(*[
@@ -2320,7 +2320,7 @@ class MultiplicativeGroupOfComplexNumbers(AdditiveGroupOfComplexNumbers):
target = self.plane.copy()
target.apply_complex_function(lambda w : z*w)
for dot in target.zero_dot, target.one_dot:
- dot.scale_to_fit_width(2*self.dot_radius)
+ dot.set_width(2*self.dot_radius)
angle = np.angle(z)
kwargs["path_arc"] = kwargs.get("path_arc", angle)
self.play(
@@ -3272,7 +3272,7 @@ class EmeraldLogo(SVGMobject):
}
def __init__(self, **kwargs):
SVGMobject.__init__(self, **kwargs)
- self.scale_to_fit_height(1)
+ self.set_height(1)
for submob in self.split()[18:]:
submob.set_color(self.helix_color)
@@ -3287,7 +3287,7 @@ class ECLPromo(PiCreatureScene):
logo_part2 = VGroup(*logo[15:])
rect = Rectangle(height = 9, width = 16)
- rect.scale_to_fit_height(5)
+ rect.set_height(5)
rect.next_to(logo, DOWN)
rect.to_edge(LEFT)
diff --git a/old_projects/eoc/chapter1.py b/old_projects/eoc/chapter1.py
index 7c3028c0e..4dbf62e94 100644
--- a/old_projects/eoc/chapter1.py
+++ b/old_projects/eoc/chapter1.py
@@ -221,7 +221,7 @@ class Introduction(TeacherStudentsScene):
this_video.save_state()
this_video.set_fill(opacity = 0)
this_video.center()
- this_video.scale_to_fit_height(FRAME_HEIGHT)
+ this_video.set_height(FRAME_HEIGHT)
self.this_video = this_video
@@ -381,7 +381,7 @@ class Introduction(TeacherStudentsScene):
class PreviewFrame(Scene):
def construct(self):
frame = Rectangle(height = 9, width = 16, color = WHITE)
- frame.scale_to_fit_height(1.5*FRAME_Y_RADIUS)
+ frame.set_height(1.5*FRAME_Y_RADIUS)
colors = iter(color_gradient([BLUE, YELLOW], 3))
titles = [
@@ -1410,7 +1410,7 @@ class GraphRectangles(CircleScene, GraphScene):
arranged_group.add(last_ring.target)
arranged_group.arrange_submobjects(DOWN, buff = SMALL_BUFF)
- arranged_group.scale_to_fit_height(FRAME_HEIGHT-1)
+ arranged_group.set_height(FRAME_HEIGHT-1)
arranged_group.to_corner(DOWN+LEFT, buff = MED_SMALL_BUFF)
for mob in tex_mobs:
mob.scale_in_place(0.7)
@@ -1722,7 +1722,7 @@ class RecapCircleSolution(GraphRectangles, ReconfigurableScene):
self.integral_condition[0][0],
words[0]
)
- arc.scale_to_fit_height(
+ arc.set_height(
arc_next_to_group.get_height()-MED_LARGE_BUFF
)
arc.next_to(arc_next_to_group, LEFT, SMALL_BUFF)
@@ -2078,7 +2078,7 @@ class AreaUnderParabola(GraphScene):
fill_color = WHITE,
fill_opacity = 1,
)
- triangle.scale_to_fit_height(0.25)
+ triangle.set_height(0.25)
triangle.move_to(self.v_lines[1].get_bottom(), UP)
x_label = TexMobject("x")
x_label.next_to(triangle, DOWN)
@@ -2587,7 +2587,7 @@ class AlternateAreaUnderCurve(PlayingTowardsDADX):
class NextVideoWrapper(Scene):
def construct(self):
rect = Rectangle(height = 9, width = 16)
- rect.scale_to_fit_height(1.5*FRAME_Y_RADIUS)
+ rect.set_height(1.5*FRAME_Y_RADIUS)
titles = [
TextMobject("Chapter %d:"%d, s)
for d, s in [
@@ -2781,7 +2781,7 @@ class Thumbnail(AlternateAreaUnderCurve):
Essence of
calculus
""")
- words.scale_to_fit_width(9)
+ words.set_width(9)
words.to_edge(UP)
self.add(graph, rects, words)
diff --git a/old_projects/eoc/chapter10.py b/old_projects/eoc/chapter10.py
index d78d3e5f7..e4610e6ad 100644
--- a/old_projects/eoc/chapter10.py
+++ b/old_projects/eoc/chapter10.py
@@ -1866,7 +1866,7 @@ class EachTermControlsOneDerivative(Scene):
buff = LARGE_BUFF,
aligned_edge = UP
)
- deriv_words.scale_to_fit_width(FRAME_WIDTH - MED_LARGE_BUFF)
+ deriv_words.set_width(FRAME_WIDTH - MED_LARGE_BUFF)
deriv_words.to_edge(UP)
for const, deriv, color in zip(consts, deriv_words, colors):
@@ -2118,7 +2118,7 @@ class TranslationOfInformation(CubicAndQuarticApproximations):
)))
group.add(TexMobject("\\vdots"))
group.arrange_submobjects(DOWN, buff = SMALL_BUFF)
- group.scale_to_fit_height(FRAME_HEIGHT - MED_LARGE_BUFF)
+ group.set_height(FRAME_HEIGHT - MED_LARGE_BUFF)
group.to_edge(LEFT)
for dx, d0, color in zip(derivs_at_x, derivs_at_zero, self.colors):
for d in dx, d0:
@@ -2271,7 +2271,7 @@ class TranslationOfInformation(CubicAndQuarticApproximations):
for arg in ("x", "0", "a")
]
derivs_at_x.arrange_submobjects(DOWN, buff = MED_LARGE_BUFF)
- derivs_at_x.scale_to_fit_height(FRAME_HEIGHT - MED_LARGE_BUFF)
+ derivs_at_x.set_height(FRAME_HEIGHT - MED_LARGE_BUFF)
derivs_at_x.to_edge(LEFT)
zeros = VGroup(*[
deriv.get_part_by_tex("0")
@@ -2531,7 +2531,7 @@ class ExpPolynomial(TranslationOfInformation, ExampleApproximationWithExp):
)))
group.add(TexMobject("\\vdots"))
group.arrange_submobjects(DOWN, buff = 2*SMALL_BUFF)
- group.scale_to_fit_height(FRAME_HEIGHT - MED_LARGE_BUFF)
+ group.set_height(FRAME_HEIGHT - MED_LARGE_BUFF)
group.to_edge(LEFT)
for dx, d0 in zip(derivs_at_x, derivs_at_zero):
for d in dx, d0:
@@ -2774,7 +2774,7 @@ class SecondTermIntuition(AreaIsDerivative):
stretch = True
)
circle = Circle(color = RED)
- circle.scale_to_fit_height(triangle.get_height())
+ circle.set_height(triangle.get_height())
circle.replace(triangle, dim_to_match = 1)
circle.scale_in_place(1.3)
@@ -2908,9 +2908,9 @@ class SecondTermIntuition(AreaIsDerivative):
for mob in (self.dark_area, self.rect, self.triangle)
]
mini_area.set_fill(BLUE_E, opacity = 1)
- mini_area.scale_to_fit_height(1)
- mini_rect.scale_to_fit_height(1)
- mini_triangle.scale_to_fit_height(0.5)
+ mini_area.set_height(1)
+ mini_rect.set_height(1)
+ mini_triangle.set_height(0.5)
geometric_taylor = VGroup(
TexMobject("f(x) \\approx "), mini_area,
@@ -3565,7 +3565,7 @@ class MoreToBeSaid(TeacherStudentsScene):
words.to_edge(UP)
fade_rect = FullScreenFadeRectangle()
rect = Rectangle(height = 9, width = 16)
- rect.scale_to_fit_height(FRAME_Y_RADIUS)
+ rect.set_height(FRAME_Y_RADIUS)
rect.to_corner(UP+RIGHT)
randy = self.get_students()[1]
@@ -3654,7 +3654,7 @@ class Thumbnail(ExampleApproximationWithSine):
self.add(cos_graph, quad_graph, quartic)
title = TextMobject("Taylor Series")
- title.scale_to_fit_width(1.5*FRAME_X_RADIUS)
+ title.set_width(1.5*FRAME_X_RADIUS)
title.add_background_rectangle()
title.to_edge(UP)
self.add(title)
diff --git a/old_projects/eoc/chapter2.py b/old_projects/eoc/chapter2.py
index e5686877a..3e6f69b12 100644
--- a/old_projects/eoc/chapter2.py
+++ b/old_projects/eoc/chapter2.py
@@ -179,7 +179,7 @@ class FathersOfCalculus(Scene):
men = Mobject()
for name in self.names:
image = ImageMobject(name, invert = False)
- image.scale_to_fit_height(self.picture_height)
+ image.set_height(self.picture_height)
title = TextMobject(name)
title.scale(0.8)
title.next_to(image, DOWN)
@@ -559,7 +559,7 @@ class ShowSpeedometer(IntroduceCar):
vect = rotate_vector(RIGHT, angle)
tick = Line((1-self.tick_length)*vect, vect)
label = TexMobject(str(10*index))
- label.scale_to_fit_height(self.tick_length)
+ label.set_height(self.tick_length)
label.shift((1+self.tick_length)*vect)
speedometer.add(tick, label)
@@ -590,7 +590,7 @@ class ShowSpeedometer(IntroduceCar):
speedometer.save_state()
speedometer.rotate(-np.pi/2, UP)
- speedometer.scale_to_fit_height(self.car.get_height()/4)
+ speedometer.set_height(self.car.get_height()/4)
speedometer.move_to(self.car)
speedometer.shift((self.car.get_width()/4)*RIGHT)
@@ -1723,7 +1723,7 @@ class TCubedExample(SecantLineToTangentLine):
- 2^3
}{dt}
""")
- expression.scale_to_fit_width(
+ expression.set_width(
VGroup(self.lhs, self.rhs).get_width()
)
expression.next_to(
@@ -1964,7 +1964,7 @@ class YouWouldntDoThisEveryTime(TeacherStudentsScene):
self.wait(3)
series = VideoSeries()
- series.scale_to_fit_width(FRAME_WIDTH-1)
+ series.set_width(FRAME_WIDTH-1)
series.to_edge(UP)
this_video = series[1]
next_video = series[2]
@@ -2012,7 +2012,7 @@ class ContrastConcreteDtWithLimit(Scene):
l_formula[27:29],
l_formula[35:37],
)).set_color(TIME_COLOR)
- l_formula.scale_to_fit_width(FRAME_X_RADIUS-MED_LARGE_BUFF)
+ l_formula.set_width(FRAME_X_RADIUS-MED_LARGE_BUFF)
l_formula.to_edge(LEFT)
l_brace = Brace(l_formula, DOWN)
@@ -2399,7 +2399,7 @@ class TinyMovement(ZoomedScene):
class NextVideos(TeacherStudentsScene):
def construct(self):
series = VideoSeries()
- series.scale_to_fit_width(FRAME_WIDTH - 1)
+ series.set_width(FRAME_WIDTH - 1)
series.to_edge(UP)
series[1].set_color(YELLOW)
self.add(series)
@@ -2475,7 +2475,7 @@ class Promotion(PiCreatureScene):
url_rect.stretch_in_place(1.1, dim = 1)
rect = Rectangle(height = 9, width = 16)
- rect.scale_to_fit_height(4.5)
+ rect.set_height(4.5)
rect.next_to(url, DOWN)
rect.to_edge(LEFT)
mathy = Mathematician()
@@ -2564,7 +2564,7 @@ class Thumbnail(SecantLineToTangentLine):
VGroup(*self.get_mobjects()).fade(0.4)
title = TextMobject("Derivative paradox")
- title.scale_to_fit_width(FRAME_WIDTH-1)
+ title.set_width(FRAME_WIDTH-1)
title.to_edge(UP)
title.add_background_rectangle()
title.set_color_by_gradient(GREEN, YELLOW)
diff --git a/old_projects/eoc/chapter3.py b/old_projects/eoc/chapter3.py
index 24fc064c5..2301b7ea8 100644
--- a/old_projects/eoc/chapter3.py
+++ b/old_projects/eoc/chapter3.py
@@ -139,7 +139,7 @@ class ContrastAbstractAndConcrete(Scene):
for x in range(20)
for y in range(10)
])
- pis.scale_to_fit_height(3)
+ pis.set_height(3)
pis.center()
pis.to_edge(DOWN, buff = SMALL_BUFF)
pis.shift(FRAME_X_RADIUS*RIGHT/2.)
@@ -195,7 +195,7 @@ class ListOfRules(PiCreatureScene):
aligned_edge = LEFT,
)
rules[-1].shift(MED_LARGE_BUFF*RIGHT)
- rules.scale_to_fit_height(FRAME_HEIGHT-1)
+ rules.set_height(FRAME_HEIGHT-1)
rules.next_to(self.pi_creature, RIGHT)
rules.to_edge(DOWN)
@@ -316,7 +316,7 @@ class DerivativeOfXSquaredAsGraph(GraphScene, ZoomedScene, PiCreatureScene):
self.ss_group = ss_group
def position_little_rectangle(self, rect, ss_group):
- rect.scale_to_fit_width(3*self.dx)
+ rect.set_width(3*self.dx)
rect.move_to(
ss_group.dx_line.get_left()
)
@@ -1301,7 +1301,7 @@ class PatternForPowerRule(PiCreatureScene):
DOWN, aligned_edge = LEFT,
buff = MED_LARGE_BUFF
)
- derivatives.scale_to_fit_height(FRAME_HEIGHT-1)
+ derivatives.set_height(FRAME_HEIGHT-1)
derivatives.to_edge(LEFT)
self.play(FadeIn(derivatives[0]))
@@ -1933,7 +1933,7 @@ class OneOverX(PiCreatureScene, GraphScene):
area_label.scale(self.area_label_scale_factor)
max_width = max(result.rectangle.get_width()-2*SMALL_BUFF, 0)
if area_label.get_width() > max_width:
- area_label.scale_to_fit_width(max_width)
+ area_label.set_width(max_width)
area_label.move_to(result.rectangle)
result.area_label = area_label
@@ -2145,7 +2145,7 @@ class DerivativeOfSineIsSlope(Scene):
"\\frac{d(\\sin(\\theta))}{d\\theta} = ",
"\\text{Slope of this graph}"
)
- tex.scale_to_fit_width(FRAME_WIDTH-1)
+ tex.set_width(FRAME_WIDTH-1)
tex.to_edge(DOWN)
VGroup(*tex[0][2:8]).set_color(BLUE)
VGroup(*tex[1][-9:]).set_color(BLUE)
@@ -2541,11 +2541,11 @@ class DerivativeFromZoomingInOnSine(IntroduceUnitCircleWithSine, ZoomedScene):
)
d_sine_line = Line(interim_point, nudged_point, color = DERIVATIVE_COLOR)
d_sine_brace = Brace(Line(ORIGIN, UP), LEFT)
- d_sine_brace.scale_to_fit_height(d_sine_line.get_height())
+ d_sine_brace.set_height(d_sine_line.get_height())
d_sine_brace.next_to(d_sine_line, LEFT, buff = SMALL_BUFF/self.zoom_factor)
d_sine = TexMobject("d(\\sin(\\theta))")
d_sine.set_color(d_sine_line.get_color())
- d_sine.scale_to_fit_width(1.5*self.d_theta*self.unit_length)
+ d_sine.set_width(1.5*self.d_theta*self.unit_length)
d_sine.next_to(d_sine_brace, LEFT, SMALL_BUFF/self.zoom_factor)
self.play(ShowCreation(d_theta_arc))
@@ -2768,7 +2768,7 @@ class Promotion(PiCreatureScene):
url.to_corner(UP+LEFT)
rect = Rectangle(height = 9, width = 16)
- rect.scale_to_fit_height(5.5)
+ rect.set_height(5.5)
rect.next_to(url, DOWN)
rect.to_edge(LEFT)
@@ -2797,12 +2797,12 @@ class Thumbnail(NudgeSideLengthOfCube):
)
VGroup(*formula[:5]).set_color(YELLOW)
VGroup(*formula[-3:]).set_color(GREEN_B)
- formula.scale_to_fit_width(FRAME_X_RADIUS-1)
+ formula.set_width(FRAME_X_RADIUS-1)
formula.to_edge(RIGHT)
self.add(formula)
title = TextMobject("Geometric derivatives")
- title.scale_to_fit_width(FRAME_WIDTH-1)
+ title.set_width(FRAME_WIDTH-1)
title.to_edge(UP)
self.add(title)
diff --git a/old_projects/eoc/chapter4.py b/old_projects/eoc/chapter4.py
index 56474d0db..befc56090 100644
--- a/old_projects/eoc/chapter4.py
+++ b/old_projects/eoc/chapter4.py
@@ -245,7 +245,7 @@ class ComingUp(Scene):
def construct(self):
rect = Rectangle(height = 9, width = 16)
rect.set_stroke(WHITE)
- rect.scale_to_fit_height(FRAME_HEIGHT-2)
+ rect.set_height(FRAME_HEIGHT-2)
title = TextMobject("Coming up...")
title.to_edge(UP)
rect.next_to(title, DOWN)
@@ -855,7 +855,7 @@ class IntroduceProductAsArea(ReconfigurableScene):
v_line = Line(ORIGIN, UP, color = WHITE, stroke_width = 2)
def v_line_update(v_line):
x = x_axis.point_to_number(self.x_slider[1].get_top())
- v_line.scale_to_fit_height(np.sin(x)*scale_factor)
+ v_line.set_height(np.sin(x)*scale_factor)
v_line.move_to(x_axis.number_to_point(x), DOWN)
v_line_update(v_line)
@@ -1337,7 +1337,7 @@ class IntroduceProductAsArea(ReconfigurableScene):
fill_opacity = 0.8,
stroke_width = 0,
)
- triangle.scale_to_fit_height(self.x_slider_handle_height)
+ triangle.set_height(self.x_slider_handle_height)
triangle.move_to(line.number_to_point(x), UP)
x_mob = TexMobject("x")
@@ -1866,7 +1866,7 @@ class ThreeLinesChainRule(ReconfigurableScene):
fill_opacity = 0.75,
stroke_width = 0,
)
- triangle.scale_to_fit_height(self.triangle_height)
+ triangle.set_height(self.triangle_height)
triangle.move_to(
number_line.number_to_point(func(x)), DOWN
)
@@ -2261,7 +2261,7 @@ class Thumbnail(IntroduceProductAsArea):
blg[1][1].next_to(df_boxes[-1], RIGHT)
df_box_labels = self.get_df_box_labels(df_boxes)
blg.add(df_boxes, df_box_labels)
- blg.scale_to_fit_height(FRAME_HEIGHT-2*MED_LARGE_BUFF)
+ blg.set_height(FRAME_HEIGHT-2*MED_LARGE_BUFF)
blg.center()
self.add(blg)
diff --git a/old_projects/eoc/chapter5.py b/old_projects/eoc/chapter5.py
index 2095c286c..faec8028e 100644
--- a/old_projects/eoc/chapter5.py
+++ b/old_projects/eoc/chapter5.py
@@ -29,7 +29,7 @@ class LastVideo(TeacherStudentsScene):
known_formulas.arrange_submobjects(
DOWN, buff = MED_LARGE_BUFF,
)
- known_formulas.scale_to_fit_height(2.5)
+ known_formulas.set_height(2.5)
exp_question = TexMobject("2^x", ", 7^x, ", "e^x", " ???")
last_video_brace = Brace(last_video)
@@ -331,7 +331,7 @@ class DoublingPopulation(PiCreatureScene):
for x in range(width)
]).arrange_submobjects(RIGHT, buff = MED_LARGE_BUFF)
creatures = VGroup(*it.chain(*creature_array))
- creatures.scale_to_fit_height(self.pi_creature_grid_height)
+ creatures.set_height(self.pi_creature_grid_height)
creatures.to_corner(DOWN+RIGHT)
colors = color_gradient([BLUE, GREEN, GREY_BROWN], len(creatures))
@@ -424,7 +424,7 @@ class DoublingPopulation(PiCreatureScene):
"From day", str(curr_day),
"to", str(curr_day+1), ":"
)
- top_words.scale_to_fit_width(4)
+ top_words.set_width(4)
top_words.next_to(
self.function, DOWN,
buff = MED_LARGE_BUFF,
@@ -727,7 +727,7 @@ class AnalyzeExponentRatio(PiCreatureScene):
one.move_to(ratio[5], DOWN)
lp, rp = parens = TexMobject("()")
parens.stretch(1.3, 1)
- parens.scale_to_fit_height(ratio.get_height())
+ parens.set_height(ratio.get_height())
lp.next_to(ratio, LEFT, buff = 0)
rp.next_to(ratio, RIGHT, buff = 0)
@@ -1228,7 +1228,7 @@ class Chapter4Wrapper(Scene):
title = TextMobject("Chapter 4 chain rule intuition")
title.to_edge(UP)
rect = Rectangle(width = 16, height = 9)
- rect.scale_to_fit_height(1.5*FRAME_Y_RADIUS)
+ rect.set_height(1.5*FRAME_Y_RADIUS)
rect.next_to(title, DOWN)
self.add(title)
@@ -1592,7 +1592,7 @@ class ManyExponentialForms(TeacherStudentsScene):
]
group = VGroup(lhs, *rhs_list)
group.arrange_submobjects(RIGHT)
- group.scale_to_fit_width(FRAME_WIDTH - LARGE_BUFF)
+ group.set_width(FRAME_WIDTH - LARGE_BUFF)
group.next_to(self.get_pi_creatures(), UP, 2*LARGE_BUFF)
for part in group:
part.set_color_by_tex("t", YELLOW)
@@ -1689,9 +1689,9 @@ class TemperatureOverTimeOfWarmWater(GraphScene):
graph.points[-1],
graph.points[-1][0]*RIGHT + h_line.get_center()[1]*UP
)
- brace.scale_to_fit_height(v_line.get_height())
+ brace.set_height(v_line.get_height())
brace.next_to(v_line, RIGHT, SMALL_BUFF)
- label.scale_to_fit_height(min(
+ label.set_height(min(
label.get_height(),
brace.get_height()
))
@@ -2006,7 +2006,7 @@ class Thumbnail(GraphOfTwoToT):
derivative.to_corner(DOWN+RIGHT, buff = MED_SMALL_BUFF)
# brace = Brace(Line(LEFT, RIGHT), UP)
- # brace.scale_to_fit_width(derivative[1].get_width())
+ # brace.set_width(derivative[1].get_width())
# brace.next_to(derivative[1], UP)
# question = TextMobject("Why?")
# question.scale(2.5)
diff --git a/old_projects/eoc/chapter6.py b/old_projects/eoc/chapter6.py
index e06c98866..0062f2a36 100644
--- a/old_projects/eoc/chapter6.py
+++ b/old_projects/eoc/chapter6.py
@@ -1250,7 +1250,7 @@ class CompareLadderAndCircle(PiCreatureScene, ThreeDScene):
circle_scene = LightweightCircleExample()
circle_mobs = VGroup(*circle_scene.get_top_level_mobjects())
for mobs, vect in (ladder_mobs, LEFT), (circle_mobs, RIGHT):
- mobs.scale_to_fit_height(FRAME_Y_RADIUS-MED_LARGE_BUFF)
+ mobs.set_height(FRAME_Y_RADIUS-MED_LARGE_BUFF)
mobs.next_to(
self.pi_creature.get_corner(UP+vect), UP,
buff = SMALL_BUFF,
@@ -1553,7 +1553,7 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample):
lil_rect.shift(0.05*lil_rect.get_width()*LEFT)
lil_rect.shift(0.2*lil_rect.get_height()*DOWN)
lil_rect.save_state()
- lil_rect.scale_to_fit_height(FRAME_Y_RADIUS - MED_LARGE_BUFF)
+ lil_rect.set_height(FRAME_Y_RADIUS - MED_LARGE_BUFF)
lil_rect.move_to(s_label, UP)
lil_rect.shift(MED_SMALL_BUFF*UP)
self.wait()
@@ -1575,9 +1575,9 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample):
"%d + dx"%int(self.example_point[0]),
"%d + dy"%int(self.example_point[1]),
)
- new_dot.scale_to_fit_height(dot.get_height())
+ new_dot.set_height(dot.get_height())
new_dot.move_to(new_point)
- new_s_label.scale_to_fit_height(s_label.get_height())
+ new_s_label.set_height(s_label.get_height())
new_s_label.scale(0.8)
new_s_label.next_to(
new_dot, DOWN,
@@ -2054,7 +2054,7 @@ class AlternateExample(ZoomedScene):
mnemonic.set_color_by_tex("d-Right", RED)
mnemonic.set_color_by_tex("d-Left", GREEN)
mnemonic.add_background_rectangle()
- mnemonic.scale_to_fit_width(FRAME_X_RADIUS-2*MED_LARGE_BUFF)
+ mnemonic.set_width(FRAME_X_RADIUS-2*MED_LARGE_BUFF)
mnemonic.next_to(ORIGIN, UP)
mnemonic.to_edge(LEFT)
@@ -2064,7 +2064,7 @@ class AlternateExample(ZoomedScene):
)
derivative.set_color_by_tex("dx", GREEN)
derivative.set_color_by_tex("dy", RED)
- derivative.scale_to_fit_width(FRAME_X_RADIUS - 2*MED_LARGE_BUFF)
+ derivative.set_width(FRAME_X_RADIUS - 2*MED_LARGE_BUFF)
derivative.next_to(
brace, DOWN,
buff = MED_LARGE_BUFF,
diff --git a/old_projects/eoc/chapter7.py b/old_projects/eoc/chapter7.py
index 3916fcd28..937a18734 100644
--- a/old_projects/eoc/chapter7.py
+++ b/old_projects/eoc/chapter7.py
@@ -460,7 +460,7 @@ class DiscussLowercaseDs(RefreshOnDerivativeDefinition, PiCreatureScene, ZoomedS
formal_definition_words = TextMobject("""
Formal derivative definition
""")
- formal_definition_words.scale_to_fit_width(rhs_rect.get_width())
+ formal_definition_words.set_width(rhs_rect.get_width())
formal_definition_words.next_to(rhs_rect, UP)
formal_definition_words.set_color(rhs_rect.get_color())
formal_definition_words.add_background_rectangle()
@@ -590,7 +590,7 @@ class DiscussLowercaseDs(RefreshOnDerivativeDefinition, PiCreatureScene, ZoomedS
self.wait()
self.add(self.rhs)
self.play(
- lil_rect.scale_to_fit_width,
+ lil_rect.set_width,
self.ss_group.dx_line.get_width()*4,
run_time = 4
)
@@ -1596,7 +1596,7 @@ class EpsilonDeltaExample(GraphLimitExpression, ZoomedScene):
result.epsilon_lines.set_stroke(MAROON_B, width = 2)
brace = Brace(Line(ORIGIN, 0.5*UP), RIGHT)
result.braces = VGroup(*[
- brace.copy().scale_to_fit_height(
+ brace.copy().set_height(
group.get_height()
).next_to(group, RIGHT, SMALL_BUFF)
for i in (1, 2)
@@ -1607,7 +1607,7 @@ class EpsilonDeltaExample(GraphLimitExpression, ZoomedScene):
for brace in result.braces
])
for label, brace in zip(result.labels, result.braces):
- label.scale_to_fit_height(min(
+ label.set_height(min(
label.get_height(),
0.8*brace.get_height()
))
@@ -1618,7 +1618,7 @@ class EpsilonDeltaExample(GraphLimitExpression, ZoomedScene):
def get_delta_group(self, delta):
result = VGroup()
brace = Brace(Line(ORIGIN, RIGHT), DOWN)
- brace.scale_to_fit_width(
+ brace.set_width(
(self.coords_to_point(delta, 0)-self.graph_origin)[0]
)
result.braces = VGroup(*[
@@ -1997,7 +1997,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi
rhs = TexMobject("= %.4f\\dots"%result)
rhs.next_to(label, RIGHT)
approx_group = VGroup(label, rhs)
- approx_group.scale_to_fit_width(FRAME_X_RADIUS-2*MED_LARGE_BUFF)
+ approx_group.set_width(FRAME_X_RADIUS-2*MED_LARGE_BUFF)
approx_group.next_to(ORIGIN, UP, buff = MED_LARGE_BUFF)
approx_group.to_edge(RIGHT)
@@ -2219,7 +2219,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi
cos_pi = VGroup(*cos_dx[:-1])
cos = VGroup(*cos_dx[:-2])
brace = Brace(Line(LEFT, RIGHT), UP)
- brace.scale_to_fit_width(cos_pi.get_width())
+ brace.set_width(cos_pi.get_width())
brace.move_to(cos_pi.get_top(), DOWN)
brace_text = TextMobject(
"""
@@ -2240,7 +2240,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi
self.play(Write(brace_text))
self.wait(2)
self.play(
- brace.scale_to_fit_width, cos.get_width(),
+ brace.set_width, cos.get_width(),
brace.next_to, cos, UP, SMALL_BUFF/self.zoom_factor,
FadeOut(brace_text)
)
@@ -2738,7 +2738,7 @@ class GeneralLHoptial(LHopitalExample):
bernoulli_image = ImageMobject("Johann_Bernoulli2")
lhopital_image = ImageMobject("Guillaume_de_L'Hopital")
for image in bernoulli_image, lhopital_image:
- image.scale_to_fit_height(self.image_height)
+ image.set_height(self.image_height)
image.to_edge(UP)
arrow = Arrow(ORIGIN, DOWN, buff = 0, color = GREEN)
@@ -2930,7 +2930,7 @@ class Thumbnail(Scene):
def construct(self):
lim = TexMobject("\\lim", "_{h", "\\to 0}")
lim.set_color_by_tex("h", GREEN)
- lim.scale_to_fit_height(5)
+ lim.set_height(5)
self.add(lim)
diff --git a/old_projects/eoc/chapter8.py b/old_projects/eoc/chapter8.py
index 35d80bcf5..4f2e35304 100644
--- a/old_projects/eoc/chapter8.py
+++ b/old_projects/eoc/chapter8.py
@@ -77,7 +77,7 @@ class Chapter8OpeningQuote(OpeningQuote, PiCreatureScene):
result.set_color_by_tex("h", GREEN, substring = False)
result.set_color_by_tex("d\\theta", GREEN)
- result.scale_to_fit_width(FRAME_WIDTH - 2*MED_SMALL_BUFF)
+ result.set_width(FRAME_WIDTH - 2*MED_SMALL_BUFF)
return result
class ThisVideo(TeacherStudentsScene):
@@ -343,7 +343,7 @@ class Chapter2Wrapper(Scene):
title = TextMobject(self.title)
title.to_edge(UP)
rect = Rectangle(width = 16, height = 9, color = WHITE)
- rect.scale_to_fit_height(1.5*FRAME_Y_RADIUS)
+ rect.set_height(1.5*FRAME_Y_RADIUS)
rect.next_to(title, DOWN)
self.add(title)
@@ -477,7 +477,7 @@ class Antiderivative(PiCreatureScene):
bottom_arc = top_arc.copy()
bottom_arc.rotate(np.pi)
arcs = VGroup(top_arc, bottom_arc)
- arcs.scale_to_fit_width(top_line.get_width())
+ arcs.set_width(top_line.get_width())
for arc in arcs:
arc.add_tip()
top_arc.next_to(top_line, UP)
@@ -1689,7 +1689,7 @@ class AreaIsDerivative(PlotVelocity, ReconfigurableScene):
def add_T_label(self, x_val, **kwargs):
triangle = RegularPolygon(n=3, start_angle = np.pi/2)
- triangle.scale_to_fit_height(MED_SMALL_BUFF)
+ triangle.set_height(MED_SMALL_BUFF)
triangle.move_to(self.coords_to_point(x_val, 0), UP)
triangle.set_fill(WHITE, 1)
triangle.set_stroke(width = 0)
@@ -2348,7 +2348,7 @@ class FundamentalTheorem(GraphScene):
self.play(
rects[i-1].set_fill, None, low_opacity,
rects[i].set_fill, None, 1,
- f_brace.scale_to_fit_height, rects[i].get_height(),
+ f_brace.set_height, rects[i].get_height(),
f_brace.next_to, rects[i], LEFT, 0,
dx_brace.next_to, rects[i], DOWN, 0,
*[
@@ -2756,7 +2756,7 @@ class Thumbnail(Chapter1Thumbnail):
dx = 0.25,
)
words = TextMobject("Integrals")
- words.scale_to_fit_width(8)
+ words.set_width(8)
words.to_edge(UP)
self.add(graph, rects, words)
diff --git a/old_projects/eoc/chapter9.py b/old_projects/eoc/chapter9.py
index 3da686149..352941a15 100644
--- a/old_projects/eoc/chapter9.py
+++ b/old_projects/eoc/chapter9.py
@@ -480,7 +480,7 @@ class TryToAddInfinitelyManyPoints(AverageOfSineStart):
sum_eq.to_edge(UP, buff = MED_SMALL_BUFF)
h_line = Line(LEFT, RIGHT)
- h_line.scale_to_fit_width(start_lines.get_width())
+ h_line.set_width(start_lines.get_width())
h_line.set_color(WHITE)
h_line.next_to(sum_eq, DOWN, aligned_edge = LEFT)
@@ -578,7 +578,7 @@ class FiniteSample(TryToAddInfinitelyManyPoints):
buff = SMALL_BUFF,
aligned_edge = DOWN
)
- # numerator.scale_to_fit_width(FRAME_X_RADIUS)
+ # numerator.set_width(FRAME_X_RADIUS)
numerator.scale(0.5)
numerator.move_to(self.coords_to_point(3*np.pi/2, 0))
numerator.to_edge(UP)
@@ -739,7 +739,7 @@ class IntegralOfSine(FiniteSample):
self.play(
rects[i-1].set_fill, None, low_opacity,
rects[i].set_fill, None, high_opacity,
- side_brace.scale_to_fit_height, rects[i].get_height(),
+ side_brace.set_height, rects[i].get_height(),
side_brace.next_to, rects[i], LEFT, SMALL_BUFF,
bottom_brace.next_to, rects[i], DOWN, SMALL_BUFF,
MaintainPositionRelativeTo(sin_x, side_brace),
@@ -886,7 +886,7 @@ class IntegralOfSine(FiniteSample):
dx.generate_target()
lp, rp = parens = TexMobject("()")
- parens.scale_to_fit_height(numerator.get_height())
+ parens.set_height(numerator.get_height())
lp.next_to(numerator, LEFT)
rp.next_to(numerator, RIGHT)
dx.target.next_to(rp, RIGHT)
@@ -904,7 +904,7 @@ class IntegralOfSine(FiniteSample):
average = VGroup(parens, numerator, dx, frac_line, pi)
integral.generate_target()
over_pi = TexMobject("\\frac{\\phantom{\\int \\sin(x)\\dx}}{\\pi}")
- integral.target.scale_to_fit_width(over_pi.get_width())
+ integral.target.set_width(over_pi.get_width())
integral.target.next_to(over_pi, UP)
integral_over_pi = VGroup(integral.target, over_pi)
integral_over_pi.to_corner(UP+RIGHT)
@@ -963,7 +963,7 @@ class IntegralOfSine(FiniteSample):
class Approx31(Scene):
def construct(self):
tex = TexMobject("\\approx 31")
- tex.scale_to_fit_width(FRAME_WIDTH - LARGE_BUFF)
+ tex.set_width(FRAME_WIDTH - LARGE_BUFF)
tex.to_edge(LEFT)
self.play(Write(tex))
self.wait(3)
@@ -1348,8 +1348,8 @@ class Antiderivative(AverageOfSineStart):
fill_color = BLACK,
fill_opacity = 0.75,
)
- big_rect.scale_to_fit_width(FRAME_WIDTH)
- big_rect.scale_to_fit_height(FRAME_HEIGHT)
+ big_rect.set_width(FRAME_WIDTH)
+ big_rect.set_height(FRAME_HEIGHT)
morty = Mortimer()
morty.to_corner(DOWN+RIGHT)
@@ -1937,7 +1937,7 @@ class LastVideoWrapper(Scene):
title.to_edge(UP)
rect = Rectangle(height = 9, width = 16)
rect.set_stroke(WHITE)
- rect.scale_to_fit_height(1.5*FRAME_Y_RADIUS)
+ rect.set_height(1.5*FRAME_Y_RADIUS)
rect.next_to(title, DOWN)
self.play(Write(title), ShowCreation(rect))
diff --git a/old_projects/eoc/footnote.py b/old_projects/eoc/footnote.py
index 14d50e748..9f1b0b83d 100644
--- a/old_projects/eoc/footnote.py
+++ b/old_projects/eoc/footnote.py
@@ -451,7 +451,7 @@ class HowToReadNotation(GraphScene, ReconfigurableScene):
brace.dx = TexMobject("dx")
max_width = 0.7*brace.get_width()
if brace.dx.get_width() > max_width:
- brace.dx.scale_to_fit_width(max_width)
+ brace.dx.set_width(max_width)
brace.dx.next_to(brace, DOWN, SMALL_BUFF)
self.play(ShowCreation(v_lines[0]))
@@ -554,7 +554,7 @@ class HowToReadNotation(GraphScene, ReconfigurableScene):
h_lines.add(h_line)
max_height = 0.8*group.get_height()
if label.get_height() > max_height:
- label.scale_to_fit_height(max_height)
+ label.set_height(max_height)
ddf_brace = Brace(h_lines, LEFT, buff = SMALL_BUFF)
@@ -739,7 +739,7 @@ class SecondDerivativeAsAcceleration(Scene):
for scene in (s_scene, v_scene, a_scene, j_scene)
]
for i, graph in enumerate(graphs):
- graph.scale_to_fit_height(FRAME_Y_RADIUS)
+ graph.set_height(FRAME_Y_RADIUS)
graph.to_corner(UP+LEFT)
graph.shift(i*DOWN/2.0)
@@ -885,7 +885,7 @@ class Thumbnail(SecondDerivativeGraphically):
tex = TexMobject("{d^n f", "\\over", "dx^n}")
tex.set_color_by_tex("d^n", YELLOW)
tex.set_color_by_tex("dx", BLUE)
- tex.scale_to_fit_height(4)
+ tex.set_height(4)
tex.to_edge(UP)
self.add(tex)
diff --git a/old_projects/eoc/old_chapter1.py b/old_projects/eoc/old_chapter1.py
index ad5dfe013..efd8c134c 100644
--- a/old_projects/eoc/old_chapter1.py
+++ b/old_projects/eoc/old_chapter1.py
@@ -219,7 +219,7 @@ class Introduction(TeacherStudentsScene):
this_video.save_state()
this_video.set_fill(opacity = 0)
this_video.center()
- this_video.scale_to_fit_height(FRAME_HEIGHT)
+ this_video.set_height(FRAME_HEIGHT)
self.this_video = this_video
words = TextMobject(
@@ -346,7 +346,7 @@ class Introduction(TeacherStudentsScene):
this_video = self.this_video
self.remove(this_video)
this_video.generate_target()
- this_video.target.scale_to_fit_height(FRAME_HEIGHT)
+ this_video.target.set_height(FRAME_HEIGHT)
this_video.target.center()
this_video.target.set_fill(opacity = 0)
@@ -920,7 +920,7 @@ class BuildToDADR(CircleScene):
new_dRs.set_color(self.dR_color)
new_outer_ring = self.get_ring(self.radius, width)
new_nudge_line = self.nudge_line.copy()
- new_nudge_line.scale_to_fit_width(width)
+ new_nudge_line.set_width(width)
new_nudge_line.move_to(self.nudge_line, LEFT)
error_brace.target = error_brace.copy()
error_brace.target.stretch_to_fit_width(
@@ -989,7 +989,7 @@ class BuildToDADR(CircleScene):
def elaborate_on_d(self):
arc = Arc(-np.pi, start_angle = -np.pi/2)
- arc.scale_to_fit_height(
+ arc.set_height(
self.change.get_center()[1]-self.change.denom.get_center()[1]
)
arc.next_to(self.change.frac_line, LEFT)
@@ -1240,13 +1240,13 @@ class NameDerivative(IntroduceTinyChangeInArea):
area_circle = self.circle.copy()
area_circle.set_stroke(width = 0)
area_circle.generate_target()
- area_circle.target.scale_to_fit_width(circle_width)
+ area_circle.target.set_width(circle_width)
area_circle.target.next_to(target_formula[0], RIGHT, buff = 0)
area_circle.target.set_color(BLUE_D)
circum_circle = self.circle.copy()
circum_circle.set_fill(opacity = 0)
circum_circle.generate_target()
- circum_circle.target.scale_to_fit_width(circle_width)
+ circum_circle.target.set_width(circle_width)
circum_circle.target.next_to(target_formula)
self.play(
@@ -1270,8 +1270,8 @@ class NameDerivative(IntroduceTinyChangeInArea):
small_dR = 0.01
big_ring = self.get_ring(self.radius, big_dR)
small_ring = self.get_ring(self.radius, small_dR)
- big_nudge_line = self.nudge_line.copy().scale_to_fit_width(big_dR)
- small_nudge_line = self.nudge_line.copy().scale_to_fit_width(small_dR)
+ big_nudge_line = self.nudge_line.copy().set_width(big_dR)
+ small_nudge_line = self.nudge_line.copy().set_width(small_dR)
for line in big_nudge_line, small_nudge_line:
line.move_to(self.nudge_line, LEFT)
new_nudge_arrow = Arrow(self.nudge_label, big_nudge_line)
@@ -2463,7 +2463,7 @@ class CalculusInANutshell(CircleScene):
first.set_fill(YELLOW)
first.save_state()
first.center()
- first.scale_to_fit_height(FRAME_Y_RADIUS*2)
+ first.set_height(FRAME_Y_RADIUS*2)
first.set_fill(opacity = 0)
everything = VGroup(*self.get_mobjects())
everything.generate_target()
@@ -2515,8 +2515,8 @@ class Thumbnail(CircleScene):
deriv_eq = TexMobject("\\frac{d \\quad}{dR} = ")
int_eq = TexMobject("\\int_0^R \\quad = ")
target_height = deriv_eq[0].get_height()*2
- area_circle.scale_to_fit_height(target_height)
- circum_circle.scale_to_fit_height(target_height)
+ area_circle.set_height(target_height)
+ circum_circle.set_height(target_height)
area_circle.next_to(deriv_eq[0], buff = SMALL_BUFF)
circum_circle.next_to(deriv_eq)
diff --git a/old_projects/eola/chapter0.py b/old_projects/eola/chapter0.py
index 11f5880bd..0c2b1767e 100644
--- a/old_projects/eola/chapter0.py
+++ b/old_projects/eola/chapter0.py
@@ -37,7 +37,7 @@ class OpeningQuote(Scene):
""",
organize_left_to_right = False
)
- words.scale_to_fit_width(2*(FRAME_X_RADIUS-1))
+ words.set_width(2*(FRAME_X_RADIUS-1))
words.to_edge(UP)
for mob in words.submobjects[48:49+13]:
mob.set_color(GREEN)
@@ -54,7 +54,7 @@ class VideoIcon(SVGMobject):
def __init__(self, **kwargs):
SVGMobject.__init__(self, "video_icon", **kwargs)
self.center()
- self.scale_to_fit_width(FRAME_WIDTH/12.)
+ self.set_width(FRAME_WIDTH/12.)
self.set_stroke(color = WHITE, width = 0)
self.set_fill(color = WHITE, opacity = 1)
@@ -272,7 +272,7 @@ class NumericVsGeometric(Scene):
"\\\\ &=",
matrix_to_tex_string([[1], [-1]]),
]))
- matrix_vector_product.scale_to_fit_width(FRAME_X_RADIUS-0.5)
+ matrix_vector_product.set_width(FRAME_X_RADIUS-0.5)
matrix_vector_product.next_to(self.vline, LEFT)
self.play(
@@ -313,7 +313,7 @@ class NumericVsGeometric(Scene):
Randolph(mode = "pondering")
]
bulb = SVGMobject("light_bulb")
- bulb.scale_to_fit_height(1)
+ bulb.set_height(1)
bulb.set_color(YELLOW)
thoughts = [
matrix_to_mobject(EXAMPLE_TRANFORM),
@@ -679,7 +679,7 @@ class LinearAlgebraIntuitions(Scene):
class MatricesAre(Scene):
def construct(self):
matrix = matrix_to_mobject([[1, -1], [1, 2]])
- matrix.scale_to_fit_height(6)
+ matrix.set_height(6)
arrow = Arrow(LEFT, RIGHT, stroke_width = 8, preserve_tip_size_when_scaling = False)
arrow.scale(2)
arrow.to_edge(RIGHT)
@@ -702,7 +702,7 @@ class MatrixMultiplicationIs(Scene):
matrix2 = matrix_to_mobject([[2, 1], [1, 2]])
matrix2.set_color(GREEN)
for m in matrix1, matrix2:
- m.scale_to_fit_height(3)
+ m.set_height(3)
arrow = Arrow(LEFT, RIGHT, stroke_width = 6, preserve_tip_size_when_scaling = False)
arrow.scale(2)
arrow.to_edge(RIGHT)
@@ -747,7 +747,7 @@ class DeterminantsAre(Scene):
\\end{array}
\\right]\\right)
""")
- tex_mob.scale_to_fit_height(4)
+ tex_mob.set_height(4)
arrow = Arrow(LEFT, RIGHT, stroke_width = 8, preserve_tip_size_when_scaling = False)
arrow.scale(2)
arrow.to_edge(RIGHT)
@@ -862,7 +862,7 @@ class TableOfContents(Scene):
def series_of_videos(self, chapters):
icon = SVGMobject("video_icon")
icon.center()
- icon.scale_to_fit_width(FRAME_WIDTH/12.)
+ icon.set_width(FRAME_WIDTH/12.)
icon.set_stroke(color = WHITE, width = 0)
icons = [icon.copy() for chapter in chapters.split()]
colors = Color(BLUE_A).range_to(BLUE_D, len(icons))
@@ -970,8 +970,8 @@ class PauseAndPonder(Scene):
def construct(self):
pause = TexMobject("=").rotate(np.pi/2)
pause.stretch(0.5, 1)
- pause.scale_to_fit_height(1.5)
- bubble = ThoughtBubble().scale_to_fit_height(2)
+ pause.set_height(1.5)
+ bubble = ThoughtBubble().set_height(2)
pause.shift(LEFT)
bubble.next_to(pause, RIGHT, buff = 1)
@@ -985,7 +985,7 @@ class NextVideo(Scene):
title = TextMobject("Next video: Vectors, what even are they?")
title.to_edge(UP)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
self.add(title)
diff --git a/old_projects/eola/chapter1.py b/old_projects/eola/chapter1.py
index 1c65c6d95..564098873 100644
--- a/old_projects/eola/chapter1.py
+++ b/old_projects/eola/chapter1.py
@@ -206,7 +206,7 @@ class DifferentConceptions(Scene):
house = SVGMobject("house")
house.set_stroke(width = 0)
house.set_fill(BLUE_C, opacity = 1)
- house.scale_to_fit_height(3)
+ house.set_height(3)
house.center()
square_footage_words = TextMobject("Square footage:")
price_words = TextMobject("Price: ")
@@ -315,7 +315,7 @@ class DifferentConceptions(Scene):
statement = TextMobject("We'll ignore him \\\\ for now")
statement.set_color(PINK)
- statement.scale_to_fit_width(arrays.get_width())
+ statement.set_width(arrays.get_width())
statement.next_to(arrays, DOWN, buff = 1.5)
circle = Circle()
circle.shift(syms.get_bottom())
@@ -638,7 +638,7 @@ class LabeledThreeDVector(Scene):
class WriteZ(Scene):
def construct(self):
z = TexMobject("z").set_color(Z_COLOR)
- z.scale_to_fit_height(4)
+ z.set_height(4)
self.play(Write(z, run_time = 2))
self.wait(3)
@@ -773,7 +773,7 @@ class VectorAdditionNumerically(VectorScene):
plus = TexMobject("+")
equals = TexMobject("=")
randy = Randolph()
- randy.scale_to_fit_height(1)
+ randy.set_height(1)
randy.shift(-randy.get_bottom())
axes = self.add_axes()
@@ -846,7 +846,7 @@ class VectorAdditionNumerically(VectorScene):
self.add_vector(v2.get_end(), color = PINK )
sum_coords = Matrix(["1+3", "2+(-1)"])
- sum_coords.scale_to_fit_height(coords1.get_height())
+ sum_coords.set_height(coords1.get_height())
sum_coords.next_to(equals, RIGHT)
brackets = sum_coords.get_brackets()
x1, y1 = coords1.get_mob_matrix().flatten()
@@ -942,9 +942,9 @@ class ShowScalarMultiplication(VectorScene):
self.remove(label)
factor_mob = TexMobject(factor_tex)
if factor_mob.get_height() > 1:
- factor_mob.scale_to_fit_height(0.9)
+ factor_mob.set_height(0.9)
if factor_mob.get_width() > 1:
- factor_mob.scale_to_fit_width(0.9)
+ factor_mob.set_width(0.9)
factor_mob.shift(1.5*RIGHT+2.5*UP)
num_factor_parts = len(factor_mob.split())
@@ -1079,7 +1079,7 @@ class FollowingVideos(UpcomingSeriesOfVidoes):
everything.remove(last_video)
big_last_video = last_video.copy()
big_last_video.center()
- big_last_video.scale_to_fit_height(2.5*FRAME_Y_RADIUS)
+ big_last_video.set_height(2.5*FRAME_Y_RADIUS)
big_last_video.set_fill(opacity = 0)
self.play(
ApplyMethod(everything.shift, FRAME_WIDTH*LEFT),
@@ -1243,7 +1243,7 @@ class NextVideo(Scene):
title = TextMobject("Next video: Linear combinations, span, and bases")
title.to_edge(UP)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
self.add(title)
diff --git a/old_projects/eola/chapter10.py b/old_projects/eola/chapter10.py
index b10f6ac1d..a7c4a0ea8 100644
--- a/old_projects/eola/chapter10.py
+++ b/old_projects/eola/chapter10.py
@@ -21,7 +21,7 @@ class OpeningQuote(Scene):
)
words.set_color_by_tex("mathematics", BLUE)
words.set_color_by_tex("music", BLUE)
- words.scale_to_fit_width(FRAME_WIDTH - 2)
+ words.set_width(FRAME_WIDTH - 2)
words.to_edge(UP)
author = TextMobject("-Serge Lang")
author.set_color(YELLOW)
@@ -112,7 +112,7 @@ class ManyPrerequisites(Scene):
self.play(ShowCreation(h_line))
rect = Rectangle(height = 9, width = 16, color = BLUE)
- rect.scale_to_fit_width(FRAME_X_RADIUS-2)
+ rect.set_width(FRAME_X_RADIUS-2)
rects = [rect]+[rect.copy() for i in range(3)]
words = [
"Linear transformations",
@@ -127,7 +127,7 @@ class ManyPrerequisites(Scene):
Matrix(np.array(rects).reshape((2, 2)))
rects = VGroup(*rects)
- rects.scale_to_fit_height(FRAME_HEIGHT - 1.5)
+ rects.set_height(FRAME_HEIGHT - 1.5)
rects.next_to(h_line, DOWN, buff = MED_SMALL_BUFF)
self.play(Write(rects[0]))
@@ -1430,7 +1430,7 @@ class RevisitExampleTransformation(ExampleTranformationScene):
xy_array.set_color(YELLOW)
zero_array = Matrix([0, 0])
for array in xy_array, zero_array:
- array.scale_to_fit_height(self.matrix.get_height())
+ array.set_height(self.matrix.get_height())
array.add_to_back(BackgroundRectangle(array))
xy_array.next_to(self.matrix)
equals = TexMobject("=").next_to(xy_array)
@@ -1603,7 +1603,7 @@ class SolveRotationEigenvalues(Rotate90Degrees):
transformation.
""", alignment = "")
interesting_tidbit.add_background_rectangle()
- interesting_tidbit.scale_to_fit_height(FRAME_Y_RADIUS-0.5)
+ interesting_tidbit.set_height(FRAME_Y_RADIUS-0.5)
interesting_tidbit.to_corner(DOWN+RIGHT)
self.play(FadeIn(interesting_tidbit))
self.wait()
@@ -2082,7 +2082,7 @@ class LastVideo(Scene):
title = TextMobject("Last chapter: Change of basis")
title.to_edge(UP)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN, buff = MED_SMALL_BUFF)
self.add(title)
@@ -2171,7 +2171,7 @@ class ChangeToEigenBasis(ExampleTranformationScene):
]).T)
cob_matrix.rect = BackgroundRectangle(cob_matrix)
cob_matrix.add_to_back(cob_matrix.rect)
- cob_matrix.scale_to_fit_height(self.matrix.get_height())
+ cob_matrix.set_height(self.matrix.get_height())
cob_matrix.next_to(self.matrix)
brace = Brace(cob_matrix)
brace_text = brace.get_text("Change of basis matrix")
diff --git a/old_projects/eola/chapter11.py b/old_projects/eola/chapter11.py
index 951f61b51..85d16dff5 100644
--- a/old_projects/eola/chapter11.py
+++ b/old_projects/eola/chapter11.py
@@ -42,7 +42,7 @@ class OpeningQuote(Scene):
)
words.set_color_by_tex("axioms,", BLUE)
words.set_color_by_tex("difficult for the uninitiated", RED)
- words.scale_to_fit_width(FRAME_WIDTH - 2)
+ words.set_width(FRAME_WIDTH - 2)
words.to_edge(UP)
author = TextMobject("-Vladmir Arnold")
author.set_color(YELLOW)
@@ -152,7 +152,7 @@ class WhatIsA2DVector(LinearTransformationScene):
coords.target = coords.copy()
group = VGroup(v.target, coords.target)
group.arrange_submobjects(DOWN)
- group.scale_to_fit_height(coords.get_height())
+ group.set_height(coords.get_height())
group.next_to(student.arrow, RIGHT)
student.q_marks = TexMobject("???")
student.q_marks.set_color_by_gradient(BLUE, YELLOW)
@@ -283,7 +283,7 @@ class AskAbout4DPhysicsStudent(Scene):
hyper_cube = HyperCube()
thought_mobs = []
for i, mob in enumerate([line, square, cube, hyper_cube]):
- mob.scale_to_fit_height(2)
+ mob.set_height(2)
tex = TexMobject("%dD"%(i+1))
tex.next_to(mob, UP)
group = VGroup(mob, tex)
@@ -659,7 +659,7 @@ class AddTwoFunctions(FunctionGraphScene):
curr_x_point = f_lines[0].get_start()
sum_def = self.get_sum_definition(DecimalNumber(curr_x_point[0]))
- # sum_def.scale_to_fit_width(FRAME_X_RADIUS-1)
+ # sum_def.set_width(FRAME_X_RADIUS-1)
sum_def.to_corner(UP+LEFT)
arrow = Arrow(sum_def[2].get_bottom(), curr_x_point, color = WHITE)
prefix = sum_def[0]
@@ -957,7 +957,7 @@ class FromVectorsToFunctions(VectorScene):
func_tex.generate_target()
lp, rp = parens = TexMobject("()")
- parens.scale_to_fit_height(func_tex.get_height())
+ parens.set_height(func_tex.get_height())
L, equals = TexMobject("L=")
deriv = TexMobject("\\frac{d}{dx}")
new_func = TexMobject("\\frac{1}{3}x^2 - 1")
@@ -1683,7 +1683,7 @@ class IntroducePolynomialSpace(Scene):
new_coords = Matrix(["0", "0", "-5", "0", "0", "0", "0", "4", "\\vdots"])
new_coords.get_entries()[2].set_color(Z_COLOR)
new_coords.get_entries()[7].set_color(TEAL)
- new_coords.scale_to_fit_height(6)
+ new_coords.set_height(6)
new_coords.move_to(coords, aligned_edge = LEFT)
self.play(
Write(self.poly2),
@@ -2224,7 +2224,7 @@ class ListAxioms(Scene):
DOWN, buff = MED_LARGE_BUFF,
aligned_edge = LEFT
)
- axioms.scale_to_fit_width(FRAME_WIDTH-1)
+ axioms.set_width(FRAME_WIDTH-1)
axioms.next_to(h_line, DOWN, buff = MED_SMALL_BUFF)
self.play(FadeIn(
@@ -2304,7 +2304,7 @@ class VectorSpaceOfPiCreatures(Scene):
for y in range(4)
]).arrange_submobjects(DOWN, buff = 1.5)
creatures = VGroup(*it.chain(*creatures))
- creatures.scale_to_fit_height(FRAME_HEIGHT-1)
+ creatures.set_height(FRAME_HEIGHT-1)
for pi in creatures:
pi.change_mode(random.choice([
"pondering", "pondering",
@@ -2349,7 +2349,7 @@ class VectorSpaceOfPiCreatures(Scene):
transform = Transform(pi1.copy(), pi2.copy())
transform.update(0.5)
sum_pi = transform.mobject
- sum_pi.scale_to_fit_height(pi1.get_height()+pi2.get_height())
+ sum_pi.set_height(pi1.get_height()+pi2.get_height())
for pi in pis:
pi.generate_target()
plus, equals = TexMobject("+=")
diff --git a/old_projects/eola/chapter2.py b/old_projects/eola/chapter2.py
index ccb32e935..086cbd964 100644
--- a/old_projects/eola/chapter2.py
+++ b/old_projects/eola/chapter2.py
@@ -185,7 +185,7 @@ class CoordinatesAsScalarsExample2(CoordinatesAsScalars):
are the ``basis vectors'' \\\\
of the $xy$ coordinate system
""")
- text.scale_to_fit_width(FRAME_X_RADIUS-1)
+ text.set_width(FRAME_X_RADIUS-1)
text.to_corner(UP+RIGHT)
VMobject(*text.split()[:2]).set_color(X_COLOR)
VMobject(*text.split()[5:7]).set_color(Y_COLOR)
@@ -439,7 +439,7 @@ class NameLinearCombinations(Scene):
])
words.split()[1].set_color(v_color)
words.split()[3].set_color(w_color)
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
words.to_edge(UP)
equation = TexMobject([
@@ -580,7 +580,7 @@ class DefineSpan(Scene):
$\\vec{\\textbf{w}}$ is the \\\\ set of all their
linear combinations.
""")
- definition.scale_to_fit_width(FRAME_WIDTH-1)
+ definition.set_width(FRAME_WIDTH-1)
definition.to_edge(UP)
def_mobs = np.array(definition.split())
VMobject(*def_mobs[4:4+4]).set_color(PINK)
@@ -813,7 +813,7 @@ class LinearCombinationOfThreeVectorsText(Scene):
VMobject(*text.split()[-9:-7]).set_color(BLUE)
VMobject(*text.split()[-3:-1]).set_color(RED_C)
VMobject(*text.split()[:17]).set_color(GREEN)
- text.scale_to_fit_width(FRAME_WIDTH - 1)
+ text.set_width(FRAME_WIDTH - 1)
text.to_edge(UP)
equation = TextMobject("""$
@@ -875,7 +875,7 @@ class SpanCasesWords(Scene):
VMobject(*words2.split()[10:13]).set_color(RED)
for words in words1, words2:
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
self.play(Write(words1))
self.wait()
self.play(Transform(words1, words2))
@@ -912,7 +912,7 @@ class LinearDependentWords(Scene):
rest.set_color(YELLOW)
for words in words1, words2:
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
self.play(Write(words1))
self.wait()
@@ -1232,7 +1232,7 @@ class TechnicalDefinitionOfBasis(Scene):
b.set_color(BLUE)
li.set_color(GREEN)
s.set_color(YELLOW)
- definition.scale_to_fit_width(FRAME_WIDTH-1)
+ definition.set_width(FRAME_WIDTH-1)
self.add(title)
self.play(Write(definition))
@@ -1243,7 +1243,7 @@ class NextVideo(Scene):
title = TextMobject("Next video: Matrices as linear transformations")
title.to_edge(UP)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
self.add(title)
diff --git a/old_projects/eola/chapter3.py b/old_projects/eola/chapter3.py
index f687a5064..6f9aa949b 100644
--- a/old_projects/eola/chapter3.py
+++ b/old_projects/eola/chapter3.py
@@ -12,7 +12,7 @@ class OpeningQuote(Scene):
"is. You have to",
"see it for yourself.",
])
- words.scale_to_fit_width(FRAME_WIDTH - 2)
+ words.set_width(FRAME_WIDTH - 2)
words.to_edge(UP)
words.split()[1].set_color(GREEN)
words.split()[3].set_color(BLUE)
@@ -958,7 +958,7 @@ class MatrixVectorMultiplication(LinearTransformationScene):
def multiply_by_vector(self, matrix):
vector = Matrix(["x", "y"]) if self.abstract else Matrix([5, 7])
- vector.scale_to_fit_height(matrix.get_height())
+ vector.set_height(matrix.get_height())
vector.next_to(matrix, buff = 2)
brace = Brace(vector, DOWN)
words = TextMobject("Any ol' vector")
@@ -1090,7 +1090,7 @@ class ColumnsToBasisVectors(LinearTransformationScene):
if vector_coords is not None:
vector = Matrix(vector_coords)
VMobject(*vector.get_mob_matrix().flatten()).set_color(YELLOW)
- vector.scale_to_fit_height(matrix_mob.get_height())
+ vector.set_height(matrix_mob.get_height())
vector.next_to(matrix_mob, RIGHT)
vector_background = BackgroundRectangle(vector)
self.add_foreground_mobject(vector_background, vector)
@@ -1225,7 +1225,7 @@ class Describe90DegreeRotation(LinearTransformationScene):
def show_vector(self, matrix):
vector = Matrix(["x", "y"])
VMobject(*vector.get_mob_matrix().flatten()).set_color(YELLOW)
- vector.scale_to_fit_height(matrix.get_height())
+ vector.set_height(matrix.get_height())
vector.next_to(matrix, RIGHT)
v_background = BackgroundRectangle(vector)
@@ -1273,7 +1273,7 @@ class NextVideo(Scene):
title = TextMobject("Next video: Matrix multiplication as composition")
title.to_edge(UP)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
self.add(title)
@@ -1306,7 +1306,7 @@ class FinalSlide(Scene):
definition is actually equivalent to the two properties
above.
""", enforce_new_line_structure = False)
- text.scale_to_fit_height(FRAME_HEIGHT - 2)
+ text.set_height(FRAME_HEIGHT - 2)
text.to_edge(UP)
self.add(text)
self.wait()
diff --git a/old_projects/eola/chapter4.py b/old_projects/eola/chapter4.py
index 03e608061..4391265d6 100644
--- a/old_projects/eola/chapter4.py
+++ b/old_projects/eola/chapter4.py
@@ -10,7 +10,7 @@ class OpeningQuote(Scene):
"can be shortened by 50\\% if one",
"throws the matrices out."
])
- words.scale_to_fit_width(FRAME_WIDTH - 2)
+ words.set_width(FRAME_WIDTH - 2)
words.to_edge(UP)
words.split()[1].set_color(GREEN)
words.split()[3].set_color(BLUE)
@@ -384,7 +384,7 @@ class ExplainWhyItsMatrixMultiplication(Scene):
shear_matrix.set_color(PINK)
l_paren, r_paren = map(TexMobject, ["\\Big(", "\\Big)"])
for p in l_paren, r_paren:
- p.scale_to_fit_height(1.4*vect.get_height())
+ p.set_height(1.4*vect.get_height())
long_way = VMobject(
shear_matrix, l_paren, rot_matrix, vect, r_paren
)
@@ -922,7 +922,7 @@ class AskAssociativityQuestion(Scene):
def move_matrix_parentheses(self, morty, matrices):
m1, m2, m3 = matrices
parens = TexMobject(["(", ")"])
- parens.scale_to_fit_height(1.2*m1.get_height())
+ parens.set_height(1.2*m1.get_height())
lp, rp = parens.split()
state1 = VMobject(
VectorizedPoint(m1.get_left()),
@@ -1057,10 +1057,10 @@ class NextVideo(Scene):
title = TextMobject("""
Next video: Linear transformations in three dimensions
""")
- title.scale_to_fit_width(FRAME_WIDTH - 2)
+ title.set_width(FRAME_WIDTH - 2)
title.to_edge(UP)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
self.add(title)
diff --git a/old_projects/eola/chapter5.py b/old_projects/eola/chapter5.py
index 18a4ef00f..9906c2fa2 100644
--- a/old_projects/eola/chapter5.py
+++ b/old_projects/eola/chapter5.py
@@ -17,7 +17,7 @@ class Blob(Circle):
self.apply_complex_function(
lambda z : z*(1+self.random_nudge_size*(random.random()-0.5))
)
- self.scale_to_fit_height(self.height).center()
+ self.set_height(self.height).center()
def probably_contains(self, point):
border_points = np.array(self.get_anchors_and_handles()[0])
@@ -38,7 +38,7 @@ class RightHand(VMobject):
self.outline.set_stroke(color = WHITE, width = 5)
self.inlines.set_stroke(color = DARK_GREY, width = 3)
VMobject.__init__(self, self.outline, self.inlines)
- self.center().scale_to_fit_height(3)
+ self.center().set_height(3)
class OpeningQuote(Scene):
def construct(self):
@@ -49,7 +49,7 @@ class OpeningQuote(Scene):
"numbers.",
"''",
], arg_separator = "")
- # words.scale_to_fit_width(FRAME_WIDTH - 2)
+ # words.set_width(FRAME_WIDTH - 2)
words.to_edge(UP)
words.split()[1].set_color(BLUE)
words.split()[3].set_color(GREEN)
@@ -356,7 +356,7 @@ class NameDeterminant(LinearTransformationScene):
self.apply_transposed_matrix(self.t_matrix)
self.wait()
det_mob_copy = area_label.split()[0].copy()
- new_det_mob = det_mob_copy.copy().scale_to_fit_height(
+ new_det_mob = det_mob_copy.copy().set_height(
det_text.split()[0].get_height()
)
new_det_mob.next_to(det_text, RIGHT, buff = 0.2)
@@ -412,7 +412,7 @@ class NextFewVideos(Scene):
def construct(self):
icon = SVGMobject("video_icon")
icon.center()
- icon.scale_to_fit_width(FRAME_WIDTH/12.)
+ icon.set_width(FRAME_WIDTH/12.)
icon.set_stroke(color = WHITE, width = 0)
icon.set_fill(WHITE, opacity = 1)
icons = VMobject(*[icon.copy() for x in range(10)])
@@ -1018,7 +1018,7 @@ class FullFormulaExplanation(LinearTransformationScene):
formula.next_to(det_text, RIGHT)
everyone = VMobject(det_text, matrix, formula)
- everyone.scale_to_fit_width(FRAME_WIDTH - 1)
+ everyone.set_width(FRAME_WIDTH - 1)
everyone.next_to(DOWN, DOWN)
background_rect = BackgroundRectangle(everyone)
self.play(
@@ -1111,10 +1111,10 @@ class NextVideo(Scene):
title = TextMobject("""
Next video: Inverse matrices, column space and null space
""")
- title.scale_to_fit_width(FRAME_WIDTH - 2)
+ title.set_width(FRAME_WIDTH - 2)
title.to_edge(UP)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
self.add(title)
diff --git a/old_projects/eola/chapter6.py b/old_projects/eola/chapter6.py
index eda5e9efe..7516ac139 100644
--- a/old_projects/eola/chapter6.py
+++ b/old_projects/eola/chapter6.py
@@ -812,7 +812,7 @@ class DescribeInverse(LinearTransformationScene):
m.add(brace, label_mob)
text.add(m)
if text.get_width() > FRAME_WIDTH-1:
- text.scale_to_fit_width(FRAME_WIDTH-1)
+ text.set_width(FRAME_WIDTH-1)
text.center().to_corner(UP+RIGHT)
matrix.set_color(PINK)
inv_matrix.set_color(YELLOW)
@@ -1379,7 +1379,7 @@ class NameColumnSpace(Scene):
for i in 1, -1:
span_text[i].stretch(1.5, 1)
span_text[i].do_in_place(
- span_text[i].scale_to_fit_height,
+ span_text[i].set_height,
span_text.get_height()
)
for col_array, index in zip(col_arrays, [2, 4, 6]):
@@ -2002,10 +2002,10 @@ class NextVideo(Scene):
title = TextMobject("""
Next video: Nonsquare matrices
""")
- title.scale_to_fit_width(FRAME_WIDTH - 2)
+ title.set_width(FRAME_WIDTH - 2)
title.to_edge(UP)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
self.add(title)
diff --git a/old_projects/eola/chapter7.py b/old_projects/eola/chapter7.py
index 35e1b9fbb..7bea8dcac 100644
--- a/old_projects/eola/chapter7.py
+++ b/old_projects/eola/chapter7.py
@@ -34,7 +34,7 @@ class OpeningQuote(Scene):
"No one can say how it happens. "
"You either believe it or you don't.",
)
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
words.to_edge(UP)
words[0].set_color(YELLOW)
words[2].set_color("#fd9c2b")
@@ -107,7 +107,7 @@ class ThisSeriesOrdering(RandolphScene):
chapters.arrange_submobjects(
DOWN, buff = SMALL_BUFF, aligned_edge = LEFT
)
- chapters.scale_to_fit_height(1.5*FRAME_Y_RADIUS)
+ chapters.set_height(1.5*FRAME_Y_RADIUS)
chapters.next_to(line, DOWN, buff = SMALL_BUFF)
chapters.to_edge(RIGHT)
@@ -765,7 +765,7 @@ class RecommendChapter3(Scene):
""")
title.to_edge(UP)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
self.add(title)
@@ -1344,7 +1344,7 @@ class SomeKindOfConnection(Scene):
j_hat = Vector([0, 1], color = Y_COLOR)
vect = Vector(self.v_coords, color = YELLOW)
plane.add(vect, i_hat, j_hat)
- plane.scale_to_fit_width(FRAME_X_RADIUS)
+ plane.set_width(FRAME_X_RADIUS)
plane.to_edge(LEFT, buff = 0)
plane.remove(vect, i_hat, j_hat)
@@ -2032,7 +2032,7 @@ class TwoDOneDTransformationSeparateSpace(Scene):
j_hat = Vector([0, 1], color = Y_COLOR)
vect = Vector(self.v_coords, color = YELLOW)
plane.add(vect, i_hat, j_hat)
- plane.scale_to_fit_width(FRAME_X_RADIUS)
+ plane.set_width(FRAME_X_RADIUS)
plane.to_edge(LEFT, buff = 0)
plane.remove(vect, i_hat, j_hat)
@@ -2175,7 +2175,7 @@ class TranslateToTheWorldOfTransformations(TwoDOneDMatrixMultiplication):
brace = Brace(matrix, UP)
word = TextMobject("Transform")
- word.scale_to_fit_width(brace.get_width())
+ word.set_width(brace.get_width())
brace.put_at_tip(word)
word.set_color(BLUE)
@@ -2220,7 +2220,7 @@ class WhatTheVectorWantsToBe(Scene):
j_hat = Vector([0, 1], color = Y_COLOR)
vect = Vector(self.v_coords, color = YELLOW)
plane.add(vect, i_hat, j_hat)
- plane.scale_to_fit_width(FRAME_X_RADIUS)
+ plane.set_width(FRAME_X_RADIUS)
plane.to_edge(LEFT, buff = 0)
plane.remove(vect, i_hat, j_hat)
@@ -2285,10 +2285,10 @@ class NextVideo(Scene):
Next video: Cross products in the
light of linear transformations
""")
- title.scale_to_fit_height(1.2)
+ title.set_height(1.2)
title.to_edge(UP, buff = MED_SMALL_BUFF/2)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
VGroup(title, rect).show()
diff --git a/old_projects/eola/chapter8.py b/old_projects/eola/chapter8.py
index 8e13bff72..01b861ecd 100644
--- a/old_projects/eola/chapter8.py
+++ b/old_projects/eola/chapter8.py
@@ -38,7 +38,7 @@ class LastVideo(Scene):
""")
title.to_edge(UP)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
self.add(title)
@@ -470,7 +470,7 @@ class ContrastDotAndCross(Scene):
)
dot_prod.arrange_submobjects(RIGHT)
if dot_prod.get_width() > max_width:
- dot_prod.scale_to_fit_width(max_width)
+ dot_prod.set_width(max_width)
dot_prod.next_to(last_mob, DOWN, buff = MED_SMALL_BUFF)
last_mob = dot_prod
dot_prod.to_edge(LEFT)
@@ -632,10 +632,10 @@ class PrereqDeterminant(Scene):
title = TextMobject("""
Prerequisite: Understanding determinants
""")
- title.scale_to_fit_width(FRAME_WIDTH - 2)
+ title.set_width(FRAME_WIDTH - 2)
title.to_edge(UP)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
self.add(title)
@@ -1305,14 +1305,14 @@ class WriteCrossProductProperties(Scene):
"(parallelogram's area)"
)
length_words.set_color_by_tex(p_cash, P_COLOR)
- length_words.scale_to_fit_width(FRAME_X_RADIUS - 1)
+ length_words.set_width(FRAME_X_RADIUS - 1)
length_words.set_color_by_tex("(parallelogram's area)", BLUE)
length_words.next_to(VGroup(cross_product, vector), DOWN, buff = LARGE_BUFF)
perpendicular = TextMobject(
"\\centering Perpendicular to",
v_cash, "and", w_cash
)
- perpendicular.scale_to_fit_width(FRAME_X_RADIUS - 1)
+ perpendicular.set_width(FRAME_X_RADIUS - 1)
perpendicular.set_color_by_tex(v_cash, V_COLOR)
perpendicular.set_color_by_tex(w_cash, W_COLOR)
perpendicular.next_to(length_words, DOWN, buff = LARGE_BUFF)
@@ -1601,7 +1601,7 @@ class DeterminantTrick(Scene):
for parens in paren_sets:
brace = Brace(parens)
text = brace.get_text("Some number")
- text.scale_to_fit_width(brace.get_width())
+ text.set_width(brace.get_width())
self.play(
GrowFromCenter(brace),
Write(text, run_time = 2)
@@ -1638,10 +1638,10 @@ class NextVideo(Scene):
Next video: Cross products in the
light of linear transformations
""")
- title.scale_to_fit_height(1.2)
+ title.set_height(1.2)
title.to_edge(UP, buff = MED_SMALL_BUFF/2)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
self.add(title)
diff --git a/old_projects/eola/chapter8p2.py b/old_projects/eola/chapter8p2.py
index 33a05463c..64a94edb0 100644
--- a/old_projects/eola/chapter8p2.py
+++ b/old_projects/eola/chapter8p2.py
@@ -17,7 +17,7 @@ class OpeningQuote(Scene):
)
words.set_color_by_tex("difficulty of a proof:", RED)
words.set_color_by_tex("paint a landscape", GREEN)
- words.scale_to_fit_width(FRAME_WIDTH - 2)
+ words.set_width(FRAME_WIDTH - 2)
words.to_edge(UP)
author = TextMobject("-Pierre Deligne")
author.set_color(YELLOW)
@@ -128,7 +128,7 @@ class BruteForceVerification(Scene):
mob.set_color_by_tex("\\theta", GREEN)
mob.next_to(last_point, DOWN, buff = MED_SMALL_BUFF)
if mob.get_width() > max_width:
- mob.scale_to_fit_width(max_width)
+ mob.set_width(max_width)
last_point = mob
self.play(FadeIn(mob))
self.wait()
@@ -146,7 +146,7 @@ class Prerequisites(Scene):
title.set_color(YELLOW)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_width(FRAME_X_RADIUS - 1)
+ rect.set_width(FRAME_X_RADIUS - 1)
left_rect, right_rect = [
rect.copy().shift(DOWN/2).to_edge(edge)
for edge in (LEFT, RIGHT)
@@ -165,7 +165,7 @@ class Prerequisites(Scene):
self.add(title)
for chapter, rect in (chapter5, left_rect), (chapter7, right_rect):
if chapter.get_width() > rect.get_width():
- chapter.scale_to_fit_width(rect.get_width())
+ chapter.set_width(rect.get_width())
chapter.next_to(rect, UP)
self.play(
Write(chapter5),
@@ -210,7 +210,7 @@ class DotProductToTransformSymbol(Scene):
right_brace = Brace(matrix, UP)
left_words = left_brace.get_text("Dot product")
right_words = right_brace.get_text("Transform")
- right_words.scale_to_fit_width(right_brace.get_width())
+ right_words.set_width(right_brace.get_width())
right_v_brace = Brace(right_input, UP)
right_v_mob = v_mob.copy()
@@ -326,7 +326,7 @@ class ThreeStepPlan(Scene):
linear_transformation.next_to(h_line, DOWN, MED_SMALL_BUFF)
det = self.get_det()
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(3.5)
+ rect.set_height(3.5)
left_right_arrow = TexMobject("\\Leftrightarrow")
left_right_arrow.shift(DOWN)
det.next_to(left_right_arrow, LEFT)
@@ -374,7 +374,7 @@ class DefineDualTransform(Scene):
title = TextMobject("What a student might think")
title.not_real = TextMobject("Not the real cross product")
for mob in title, title.not_real:
- mob.scale_to_fit_width(FRAME_X_RADIUS - 1)
+ mob.set_width(FRAME_X_RADIUS - 1)
mob.set_color(RED)
mob.to_edge(UP)
self.add(title)
@@ -425,7 +425,7 @@ class DefineDualTransform(Scene):
final_mobs.next_to(self.title, DOWN, buff = MED_SMALL_BUFF)
for mob in definitions, final_mobs:
- mob.scale_to_fit_width(FRAME_X_RADIUS - 1)
+ mob.set_width(FRAME_X_RADIUS - 1)
for array in arrays:
brackets = array.get_brackets()
@@ -503,7 +503,7 @@ class DefineDualTransform(Scene):
func_tex.scale(0.7)
func_input = Matrix(list("xyz"))
func_input_template = VGroup(*func_tex[3:-2])
- func_input.scale_to_fit_height(func_input_template.get_height())
+ func_input.set_height(func_input_template.get_height())
func_input.next_to(VGroup(*func_tex[:3]), RIGHT)
VGroup(*func_tex[-2:]).next_to(func_input, RIGHT)
func_tex[0].scale_in_place(1.5)
@@ -548,9 +548,9 @@ class DefineDualTransform(Scene):
title.set_color(GREEN)
title.to_edge(UP)
matrix = Matrix([list(q_marks.copy())])
- matrix.scale_to_fit_height(self.func_tex.get_height()/2)
+ matrix.set_height(self.func_tex.get_height()/2)
dual_vector = Matrix(list(q_marks))
- dual_vector.scale_to_fit_height(self.func_tex.get_height())
+ dual_vector.set_height(self.func_tex.get_height())
dual_vector.get_brackets()[0].shift(0.2*LEFT)
dual_vector.get_entries().shift(0.1*LEFT)
dual_vector.scale(1.25)
@@ -608,7 +608,7 @@ class DefineDualTransform(Scene):
]))
p_coords.set_color(RED)
p_array = Matrix(list(p_coords))
- p_array.scale_to_fit_height(dual_vector.get_height())
+ p_array.set_height(dual_vector.get_height())
p_array.move_to(dual_vector, aligned_edge = RIGHT)
p_brace = Brace(p_array, UP)
p_tex = TexMobject(get_vect_tex("p"))
@@ -823,7 +823,7 @@ class DotProductWords(Scene):
times.next_to(words[0], RIGHT)
everyone = VGroup(dot_product, equals, times, words)
- everyone.center().scale_to_fit_width(FRAME_X_RADIUS - 1)
+ everyone.center().set_width(FRAME_X_RADIUS - 1)
self.add(dot_product)
self.play(Write(equals))
self.play(Write(words[0]))
@@ -855,7 +855,7 @@ class GeometricVolumeWords(Scene):
words[1].set_color_by_tex(v_tex, ORANGE)
words[1].set_color_by_tex(w_tex, W_COLOR)
words.arrange_submobjects(RIGHT)
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
words.to_edge(DOWN, buff = SMALL_BUFF)
for word in words:
self.play(Write(word))
@@ -891,7 +891,7 @@ class NextVideo(Scene):
""")
title.to_edge(UP, buff = MED_SMALL_BUFF/2)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
self.add(title)
diff --git a/old_projects/eola/chapter9.py b/old_projects/eola/chapter9.py
index 1dcea71bb..3a29a7a1d 100644
--- a/old_projects/eola/chapter9.py
+++ b/old_projects/eola/chapter9.py
@@ -46,7 +46,7 @@ class OpeningQuote(Scene):
)
words.set_color_by_tex("same name ", BLUE)
words.set_color_by_tex("different things", MAROON_B)
- # words.scale_to_fit_width(FRAME_WIDTH - 2)
+ # words.set_width(FRAME_WIDTH - 2)
words.to_edge(UP)
author = TextMobject("-Henri Poincar\\'e.")
author.set_color(YELLOW)
@@ -413,7 +413,7 @@ class IntroduceJennifer(JenniferScene):
new_coords = [-1, 2]
new_coords_mob = Matrix(new_coords)
- new_coords_mob.scale_to_fit_height(jenny.coords.get_height())
+ new_coords_mob.set_height(jenny.coords.get_height())
new_coords_mob.move_to(jenny.coords)
for coords in you.coords, jenny.coords, new_coords_mob:
@@ -598,7 +598,7 @@ class IntroduceJennifer(JenniferScene):
mover = coords.mover
array_mob = Matrix(array)
array_mob.set_color(mover.get_color())
- array_mob.scale_to_fit_height(mover.get_height())
+ array_mob.set_height(mover.get_height())
array_mob.move_to(mover)
array_mob.add_to_back(BackgroundRectangle(array_mob))
mover.target = array_mob
@@ -874,7 +874,7 @@ class TranslateFromJenny(JenniferScene):
jenny_x, jenny_y = self.jenny.coords.get_entries().copy()
equals, plus, equals2 = syms = map(TexMobject, list("=+="))
result = Matrix([-4, 1])
- result.scale_to_fit_height(self.you.coords.get_height())
+ result.set_height(self.you.coords.get_height())
for mob in syms + [self.you.coords, self.jenny.coords, result]:
mob.add_to_back(BackgroundRectangle(mob))
movers = [
@@ -923,7 +923,7 @@ class TranslateFromJenny(JenniferScene):
matrix.set_color_columns(X_COLOR, Y_COLOR)
self.jenny.coords.target = self.jenny.coords.copy()
self.jenny.coords.target.next_to(equals, LEFT)
- matrix.scale_to_fit_height(self.jenny.coords.get_height())
+ matrix.set_height(self.jenny.coords.get_height())
matrix.next_to(self.jenny.coords.target, LEFT)
matrix.add_to_back(BackgroundRectangle(matrix))
@@ -1204,7 +1204,7 @@ class RecallInverse(JenniferScene):
["1/3", "1/3"],
["-1/3", "2/3"]
])
- inv_matrix.scale_to_fit_height(matrix.get_height())
+ inv_matrix.set_height(matrix.get_height())
inv_matrix.add_to_back(BackgroundRectangle(inv_matrix))
equals.next_to(matrix, RIGHT, buff = 0.7)
inv_matrix.next_to(equals, RIGHT, buff = MED_SMALL_BUFF)
@@ -1265,7 +1265,7 @@ class WorkOutInverseComputation(Scene):
)
for mob in equation:
if isinstance(mob, Matrix):
- mob.scale_to_fit_height(2)
+ mob.set_height(2)
equation.arrange_submobjects()
matrix_brace = Brace(matrix, UP)
@@ -1352,7 +1352,7 @@ class SummarizeTranslationProcess(Scene):
our_vector = Matrix(["x_o", "y_o"])
her_vector = Matrix(["x_j", "y_j"])
for vector, color in (our_vector, BLUE_D), (her_vector, MAROON_B):
- # vector.scale_to_fit_height(1.5)
+ # vector.set_height(1.5)
vector.set_color(color)
A = TexMobject("A")
A_inv = TexMobject("A^{-1}")
@@ -1426,7 +1426,7 @@ class Prerequisites(Scene):
])
for direction, words in zip([LEFT, RIGHT], prereqs):
rect = Rectangle(height = 9, width = 16)
- rect.scale_to_fit_height(3.5)
+ rect.set_height(3.5)
rect.next_to(ORIGIN, direction, buff = MED_SMALL_BUFF)
rect.set_color(BLUE)
words.next_to(rect, UP, buff = MED_SMALL_BUFF)
@@ -1795,7 +1795,7 @@ class NextVideo(Scene):
""")
title.to_edge(UP, buff = MED_SMALL_BUFF)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
self.add(title)
diff --git a/old_projects/eola/footnote.py b/old_projects/eola/footnote.py
index 6ed291bfc..43a2a188d 100644
--- a/old_projects/eola/footnote.py
+++ b/old_projects/eola/footnote.py
@@ -13,7 +13,7 @@ class OpeningQuote(Scene):
into...(dramatic pause)...""",
"the third dimension."
])
- words.scale_to_fit_width(FRAME_WIDTH - 2)
+ words.set_width(FRAME_WIDTH - 2)
words.to_edge(UP)
words.split()[0].set_color(YELLOW)
words.split()[2].set_color(YELLOW)
@@ -126,7 +126,7 @@ class PutTogether3x3Matrix(Scene):
k_to, k_array, TexMobject("=").set_color(BLACK),
)
everything.arrange_submobjects(RIGHT, buff = 0.1)
- everything.scale_to_fit_width(FRAME_WIDTH-1)
+ everything.set_width(FRAME_WIDTH-1)
everything.to_edge(DOWN)
i_array.set_color(X_COLOR)
@@ -218,7 +218,7 @@ class ShowVCoordinateMeaning(Scene):
everything = VMobject(v, eq, coords, eq2, lin_comb)
everything.arrange_submobjects(buff = 0.2)
- everything.scale_to_fit_width(FRAME_WIDTH - 1)
+ everything.set_width(FRAME_WIDTH - 1)
everything.to_edge(DOWN)
if not self.post_transform:
lin_comb.shift(0.35*UP)
@@ -253,7 +253,7 @@ class ShowMatrixVectorMultiplication(Scene):
def construct(self):
matrix = Matrix(np.arange(9).reshape((3, 3)))
vect = Matrix(list("xyz"))
- vect.scale_to_fit_height(matrix.get_height())
+ vect.set_height(matrix.get_height())
col1, col2, col3 = columns = [
Matrix(col)
for col in matrix.copy().get_mob_matrix().transpose()
@@ -267,7 +267,7 @@ class ShowMatrixVectorMultiplication(Scene):
z, col3
)
everything.arrange_submobjects(buff = 0.1)
- everything.scale_to_fit_width(FRAME_WIDTH-1)
+ everything.set_width(FRAME_WIDTH-1)
result = VMobject(x, col1, plus1, y, col2, plus2, z, col3)
trips = [
@@ -341,7 +341,7 @@ class ShowMatrixMultiplication(Scene):
braces.append(brace)
right_brace, left_brace = braces
- VMobject(*self.get_mobjects()).scale_to_fit_width(FRAME_WIDTH-1)
+ VMobject(*self.get_mobjects()).set_width(FRAME_WIDTH-1)
self.add(right, left)
self.play(Write(right_brace))
@@ -403,10 +403,10 @@ class NextVideo(Scene):
title = TextMobject("""
Next video: The determinant
""")
- title.scale_to_fit_width(FRAME_WIDTH - 2)
+ title.set_width(FRAME_WIDTH - 2)
title.to_edge(UP)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
self.add(title)
diff --git a/old_projects/eola/footnote2.py b/old_projects/eola/footnote2.py
index 9f6bc3fdd..965378cf5 100644
--- a/old_projects/eola/footnote2.py
+++ b/old_projects/eola/footnote2.py
@@ -9,7 +9,7 @@ class OpeningQuote(Scene):
"2x3 matrix.",
"Some of you, to my great amusement, actually tried to do this.''"
)
- words.scale_to_fit_width(FRAME_WIDTH - 2)
+ words.set_width(FRAME_WIDTH - 2)
words.to_edge(UP)
words[1].set_color(GREEN)
author = TextMobject("-(Via mathprofessorquotes.com, no name listed)")
@@ -77,7 +77,7 @@ class ColumnsRepresentBasisVectors(Scene):
self.play(
ApplyFunction(
lambda m : bubble.position_mobject_inside(
- m.scale_to_fit_height(2.5)
+ m.set_height(2.5)
),
everything
),
@@ -513,10 +513,10 @@ class NextVideo(Scene):
title = TextMobject("""
Next video: Dot products and duality
""")
- title.scale_to_fit_width(FRAME_WIDTH - 2)
+ title.set_width(FRAME_WIDTH - 2)
title.to_edge(UP)
rect = Rectangle(width = 16, height = 9, color = BLUE)
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
self.add(title)
diff --git a/old_projects/eola/thumbnails.py b/old_projects/eola/thumbnails.py
index 01193d282..4c7579eca 100644
--- a/old_projects/eola/thumbnails.py
+++ b/old_projects/eola/thumbnails.py
@@ -21,7 +21,7 @@ class Chapter1(Scene):
array.set_color(TEAL)
everyone = VMobject(arrow, vs, array)
everyone.arrange_submobjects(RIGHT, buff = 0.5)
- everyone.scale_to_fit_height(4)
+ everyone.set_height(4)
self.add(everyone)
class Chapter2(LinearTransformationScene):
diff --git a/old_projects/fourier.py b/old_projects/fourier.py
index a7b7ef078..60c2a828f 100644
--- a/old_projects/fourier.py
+++ b/old_projects/fourier.py
@@ -1296,7 +1296,7 @@ class WrapCosineGraphAroundCircle(FourierMachineScene):
def get_bps_label(self, freq = 3):
braces = VGroup(*self.get_peak_braces()[freq:2*freq])
words = TextMobject("%d beats/second"%freq)
- words.scale_to_fit_width(0.9*braces.get_width())
+ words.set_width(0.9*braces.get_width())
words.move_to(braces, DOWN)
return words
@@ -4257,7 +4257,7 @@ class Thumbnail(Scene):
num_graph_points = 200,
)
pol_graph.match_color(graph)
- pol_graph.scale_to_fit_height(2)
+ pol_graph.set_height(2)
pol_graphs.add(pol_graph)
pol_graphs.arrange_submobjects(RIGHT, buff = LARGE_BUFF)
pol_graphs.set_color_by_gradient(BLUE_C, YELLOW)
@@ -4267,7 +4267,7 @@ class Thumbnail(Scene):
self.clear()
title.center().to_edge(UP)
- pol_graphs.scale_to_fit_width(FRAME_WIDTH - 1)
+ pol_graphs.set_width(FRAME_WIDTH - 1)
pol_graphs.center()
title.move_to(pol_graphs)
title.shift(SMALL_BUFF*LEFT)
diff --git a/old_projects/fractal_dimension.py b/old_projects/fractal_dimension.py
index 31b33750d..f4d0c1e2b 100644
--- a/old_projects/fractal_dimension.py
+++ b/old_projects/fractal_dimension.py
@@ -22,7 +22,7 @@ class Britain(SVGMobject):
SVGMobject.__init__(self, **kwargs)
self.points = self[0].points
self.submobjects = []
- self.scale_to_fit_height(self.height)
+ self.set_height(self.height)
self.center()
class Norway(Britain):
@@ -142,7 +142,7 @@ class WhatAreFractals(TeacherStudentsScene):
name.to_corner(UP+LEFT)
# picture = Rectangle(height = 4, width = 3)
picture = ImageMobject("Mandelbrot")
- picture.scale_to_fit_height(4)
+ picture.set_height(4)
picture.next_to(name, DOWN)
self.play(
Write(name, run_time = 2),
@@ -180,7 +180,7 @@ class IntroduceVonKochCurve(Scene):
def get_snowflake(self):
triangle = RegularPolygon(n = 3, start_angle = np.pi/2)
- triangle.scale_to_fit_height(4)
+ triangle.set_height(4)
curves = VGroup(*[
KochCurve(
order = self.order,
@@ -276,7 +276,7 @@ class SelfSimilarFractalsAsSubset(Scene):
Sierpinski(order = 5),
)
for submob in fractals:
- submob.scale_to_fit_width(self.fractal_width)
+ submob.set_width(self.fractal_width)
fractals.arrange_submobjects(RIGHT)
fractals[-1].next_to(VGroup(*fractals[:-1]), DOWN)
@@ -434,7 +434,7 @@ class InfiniteKochZoom(Scene):
color = BLUE,
stroke_width = 2,
)
- koch_curve.scale_to_fit_width(18)
+ koch_curve.set_width(18)
koch_curve.shift(
self.left_point - koch_curve.points[0]
)
@@ -459,7 +459,7 @@ class ShowIdealizations(Scene):
self.add(arrow, left_words, middle_words, right_words)
britain = Britain()[0]
- britain.scale_to_fit_height(4)
+ britain.set_height(4)
britain.next_to(arrow, UP)
anchors = britain.get_anchors()
@@ -473,7 +473,7 @@ class ShowIdealizations(Scene):
koch_snowflake = KochSnowFlake(order = 5, monochromatic = True)
koch_snowflake.set_stroke(width = 0)
koch_snowflake.set_fill(BLUE_D, opacity = 1)
- koch_snowflake.scale_to_fit_height(3)
+ koch_snowflake.set_height(3)
koch_snowflake.rotate(2*np.pi/3)
koch_snowflake.next_to(arrow, UP)
koch_snowflake.to_edge(RIGHT)
@@ -634,7 +634,7 @@ class FourSelfSimilarShapes(Scene):
shapes = VGroup(line, square, cube, sierpinski)
for shape, title in zip(shapes, titles):
- shape.scale_to_fit_width(self.shape_width)
+ shape.set_width(self.shape_width)
shape.next_to(title, DOWN, buff = MED_SMALL_BUFF)
line.shift(DOWN)
@@ -829,7 +829,7 @@ class ScaledLineMass(Scene):
)
shape = self.get_shape()
- shape.scale_to_fit_width(self.shape_width)
+ shape.set_width(self.shape_width)
shape.center()
shape.shift(FRAME_X_RADIUS*RIGHT/2 + self.vert_distance*UP)
@@ -958,7 +958,7 @@ class DefineTwoDimensional(PiCreatureScene):
def add_shape(self):
shape = self.get_shape()
- shape.scale_to_fit_width(self.shape_width)
+ shape.set_width(self.shape_width)
shape.next_to(self.title, DOWN, buff = MED_LARGE_BUFF)
# self.shape.shift(FRAME_Y_RADIUS*UP/2)
self.mass_color = shape.get_color()
@@ -1212,7 +1212,7 @@ class LengthAndAreaOfSierpinski(ShowSierpinskiCurve):
def get_curve(self, order):
# curve = ShowSierpinskiCurve.get_curve(self, order)
curve = SierpinskiCurve(order = order)
- curve.scale_to_fit_height(4).center()
+ curve.set_height(4).center()
curve.shift(FRAME_X_RADIUS*LEFT/2)
return curve
@@ -1285,7 +1285,7 @@ class DimensionOfKoch(Scene):
def add_curve(self):
curve = self.curve_class(order = self.koch_curve_order)
- curve.scale_to_fit_width(self.koch_curve_width)
+ curve.set_width(self.koch_curve_width)
curve.to_corner(UP+RIGHT, LARGE_BUFF)
self.play(ShowCreation(curve, run_time = 2))
@@ -1416,7 +1416,7 @@ class DimensionOfQuadraticKoch(DimensionOfKoch):
order = order,
monochromatic = True
)
- curve.scale_to_fit_width(self.koch_curve_width)
+ curve.set_width(self.koch_curve_width)
alpha = float(order) / self.koch_curve_order
stroke_width = interpolate(3, 1, alpha)
curve.set_stroke(width = stroke_width)
@@ -1524,7 +1524,7 @@ class ShowSeveralSelfSimilarityDimensions(Scene):
curves = VGroup()
for Class, vect in zip(fractal_classes, vects):
curve = Class(order = order)
- curve.scale_to_fit_width(2),
+ curve.set_width(2),
curve.shift(vect)
curves.add(curve)
return curves
@@ -1598,7 +1598,7 @@ class ShowDiskScaling(Scene):
britain = Britain()
shapes = VGroup(hexagon, blob, disk, britain)
for shape in shapes:
- shape.scale_to_fit_width(1.5)
+ shape.set_width(1.5)
shape.set_stroke(width = 0)
shape.set_fill(opacity = 1)
shapes.set_color_by_gradient(BLUE_B, BLUE_E)
@@ -1617,7 +1617,7 @@ class ShowDiskScaling(Scene):
disk = self.disk
self.play(
FadeOut(self.to_fade),
- disk.scale_to_fit_width, 2,
+ disk.set_width, 2,
disk.next_to, ORIGIN, LEFT, 2,
disk.set_fill, BLUE_D, 0.7
)
@@ -2003,7 +2003,7 @@ class BoxCountingSierpinski(BoxCountingScene):
sierp = Sierpinski(order = self.sierpinski_order)
sierp.set_fill(opacity = 0)
sierp.move_to(3*DOWN, DOWN+RIGHT)
- sierp.scale_to_fit_width(self.sierpinski_width)
+ sierp.set_width(self.sierpinski_width)
boxes = self.get_highlighted_boxes(sierp)
corner_rect = self.get_corner_rect()
@@ -2168,7 +2168,7 @@ class GiveShapeAndPonder(Scene):
randy.next_to(ORIGIN, DOWN).shift(3*LEFT)
norway = Norway(fill_opacity = 0, stroke_width = 1)
- norway.scale_to_fit_width(2)
+ norway.set_width(2)
norway.next_to(morty, UP+LEFT, buff = -MED_SMALL_BUFF)
self.play(
@@ -2797,12 +2797,12 @@ class FractalNonFractalFlowChart(Scene):
word.shift(arrow.get_center())
britain = Britain()
- britain.scale_to_fit_height(3)
+ britain.set_height(3)
britain.to_corner(UP+LEFT)
self.add(britain)
randy = Randolph()
- randy.scale_to_fit_height(3)
+ randy.set_height(3)
randy.to_corner(UP+RIGHT)
self.add(randy)
@@ -2868,7 +2868,7 @@ class AffirmLogo(SVGMobject):
}
def __init__(self, **kwargs):
SVGMobject.__init__(self, **kwargs)
- self.scale_to_fit_width(self.width)
+ self.set_width(self.width)
class MortyLookingAtRectangle(Scene):
def construct(self):
@@ -2877,7 +2877,7 @@ class MortyLookingAtRectangle(Scene):
url = TextMobject("affirmjobs.3b1b.co")
url.to_corner(UP+LEFT)
rect = Rectangle(height = 9, width = 16)
- rect.scale_to_fit_height(5)
+ rect.set_height(5)
rect.next_to(url, DOWN)
rect.shift_onto_screen()
url.save_state()
@@ -2927,7 +2927,7 @@ class Thumbnail(Scene):
koch_curve = QuadraticKoch(order = 6, monochromatic = True)
koch_curve.set_stroke(width = 0)
koch_curve.set_fill(BLUE)
- koch_curve.scale_to_fit_height(1.5*FRAME_Y_RADIUS)
+ koch_curve.set_height(1.5*FRAME_Y_RADIUS)
koch_curve.to_edge(DOWN, buff = SMALL_BUFF)
self.add(koch_curve, title)
diff --git a/old_projects/gradient.py b/old_projects/gradient.py
index cda1b66be..f03f77e91 100644
--- a/old_projects/gradient.py
+++ b/old_projects/gradient.py
@@ -38,7 +38,7 @@ class ShowSimpleMultivariableFunction(Scene):
many_inputs = TexMobject(*[
"x_{%d}, " % d for d in range(1, 25)
])
- many_inputs.scale_to_fit_width(FRAME_WIDTH)
+ many_inputs.set_width(FRAME_WIDTH)
many_inputs.to_edge(UL)
inputs_brace = Brace(inputs, UP)
diff --git a/old_projects/hanoi.py b/old_projects/hanoi.py
index 238b89e6a..d7a759f8f 100644
--- a/old_projects/hanoi.py
+++ b/old_projects/hanoi.py
@@ -48,7 +48,7 @@ class CountingScene(Scene):
for point in self.get_template_configuration()
])
dots[-1].set_stroke(width = 0)
- dots.scale_to_fit_height(self.dot_configuration_height)
+ dots.set_height(self.dot_configuration_height)
return dots
def initialize_configurations(self):
@@ -301,7 +301,7 @@ class TowersOfHanoiScene(Scene):
for number, disk in enumerate(self.disks):
label = TexMobject(str(number))
label.set_color(BLACK)
- label.scale_to_fit_height(self.disk_height/2)
+ label.set_height(self.disk_height/2)
label.move_to(disk)
disk.add(label)
disk.label = label
@@ -487,7 +487,7 @@ def get_base_b_tex_mob(number, base, n_digits):
for place in range(n_digits):
remainder = number%base
digit_mob = TexMobject(str(remainder))
- digit_mob.scale_to_fit_height(zero_height)
+ digit_mob.set_height(zero_height)
digit_mob.shift(place*(zero_width+SMALL_BUFF)*LEFT)
result.add(digit_mob)
number = (number - remainder)/base
@@ -508,7 +508,7 @@ class IntroduceKeith(Scene):
keith = Keith(mode = "dance_kick")
keith_image = ImageMobject("keith_schwarz", invert = False)
# keith_image = Rectangle()
- keith_image.scale_to_fit_height(FRAME_HEIGHT - 2)
+ keith_image.set_height(FRAME_HEIGHT - 2)
keith_image.next_to(ORIGIN, LEFT)
keith.move_to(keith_image, DOWN+RIGHT)
morty.next_to(keith, buff = LARGE_BUFF, aligned_edge = DOWN)
@@ -543,7 +543,7 @@ class IntroduceKeith(Scene):
self.play(Blink(morty))
self.play(
keith.change_mode, "speaking",
- keith.scale_to_fit_height, morty.get_height(),
+ keith.set_height, morty.get_height(),
keith.next_to, morty, LEFT, LARGE_BUFF,
run_time = 1.5
)
@@ -1115,8 +1115,8 @@ class IntroduceBinaryCounting(BinaryCountingScene):
def show_self_similarity(self):
cover_rect = Rectangle()
- cover_rect.scale_to_fit_width(FRAME_WIDTH)
- cover_rect.scale_to_fit_height(FRAME_HEIGHT)
+ cover_rect.set_width(FRAME_WIDTH)
+ cover_rect.set_height(FRAME_HEIGHT)
cover_rect.set_stroke(width = 0)
cover_rect.set_fill(BLACK, opacity = 0.85)
big_dot = self.curr_configurations[-1][0].copy()
@@ -1126,7 +1126,7 @@ class IntroduceBinaryCounting(BinaryCountingScene):
)
self.play(
big_dot.center,
- big_dot.scale_to_fit_height, FRAME_HEIGHT-2,
+ big_dot.set_height, FRAME_HEIGHT-2,
big_dot.to_edge, LEFT,
run_time = 5
)
@@ -1539,7 +1539,7 @@ class RecursiveSolution(TowersOfHanoiScene):
arc = Arc(-5*np.pi/6, start_angle = 5*np.pi/6)
arc.add_tip()
arc.set_color(YELLOW)
- arc.scale_to_fit_width(
+ arc.set_width(
VGroup(*self.pegs[1:]).get_width()*0.8
)
arc.next_to(self.disks[0], UP+RIGHT, buff = SMALL_BUFF)
@@ -1974,7 +1974,7 @@ class IntroduceConstrainedTowersOfHanoi(ConstrainedTowersOfHanoiScene):
peg_sets = (self.pegs[:2], self.pegs[1:])
for curved_arrow, pegs in zip(curved_arrows, peg_sets):
peg_group = VGroup(*pegs)
- curved_arrow.scale_to_fit_width(0.7*peg_group.get_width())
+ curved_arrow.set_width(0.7*peg_group.get_width())
curved_arrow.next_to(peg_group, UP)
self.play(ShowCreation(curved_arrow1))
@@ -1982,7 +1982,7 @@ class IntroduceConstrainedTowersOfHanoi(ConstrainedTowersOfHanoiScene):
self.wait()
big_curved_arrow = Arc(start_angle = 5*np.pi/6, angle = -2*np.pi/3)
- big_curved_arrow.scale_to_fit_width(0.9*self.pegs.get_width())
+ big_curved_arrow.set_width(0.9*self.pegs.get_width())
big_curved_arrow.next_to(self.pegs, UP)
big_curved_arrow.add_tip(tip_length = 0.4)
big_curved_arrow.set_color(WHITE)
@@ -2034,7 +2034,7 @@ class RecursiveSolutionToConstrained(RecursiveSolution):
]
sub_steps, sub_sub_steps = subdivisions[:2]
for steps in subdivisions:
- steps.scale_to_fit_width(FRAME_WIDTH-1)
+ steps.set_width(FRAME_WIDTH-1)
subdivisions.append(
TextMobject("\\tiny Move disk 0, Move disk 0").set_color(BLUE)
)
@@ -2417,7 +2417,7 @@ class TernaryCountingSelfSimilarPattern(Scene):
for i, color in enumerate(colors[:-1]):
step[-i-2].set_color(color)
VGroup(*steps[1::2]).set_color(colors[-1])
- steps.scale_to_fit_width(FRAME_WIDTH-1)
+ steps.set_width(FRAME_WIDTH-1)
brace = Brace(steps, UP)
word_group = VGroup(title, brace, steps)
word_group.arrange_submobjects(DOWN)
@@ -2694,7 +2694,7 @@ class AnswerConfigurationsCount(TowersOfHanoiScene):
for d in range(self.num_disks)
]))
parentheticals.arrange_submobjects()
- parentheticals.scale_to_fit_width(FRAME_WIDTH-1)
+ parentheticals.set_width(FRAME_WIDTH-1)
parentheticals.next_to(top_mob, DOWN)
for parens in parentheticals:
brace = Brace(parens)
@@ -2732,7 +2732,7 @@ class AnswerConfigurationsCount(TowersOfHanoiScene):
class ThisIsMostEfficientText(Scene):
def construct(self):
text = TextMobject("This is the most efficient solution")
- text.scale_to_fit_width(FRAME_WIDTH - 1)
+ text.set_width(FRAME_WIDTH - 1)
text.to_edge(DOWN)
self.play(Write(text))
self.wait(2)
@@ -2856,7 +2856,7 @@ class SierpinskiGraphScene(Scene):
self.nodes.add(node)
if self.include_towers:
self.add_towers_to_nodes()
- self.nodes.scale_to_fit_height(FRAME_HEIGHT-2)
+ self.nodes.set_height(FRAME_HEIGHT-2)
self.nodes.to_edge(UP)
def get_node_circles(self, order = 3):
@@ -2886,7 +2886,7 @@ class SierpinskiGraphScene(Scene):
for mob in towers:
if hasattr(mob, "label"):
self.disks[int(mob.label.tex_string)].add(mob)
- towers.scale_to_fit_width(0.85*node.get_width())
+ towers.set_width(0.85*node.get_width())
towers.move_to(node)
node.towers = towers
node.add(towers)
@@ -2977,7 +2977,7 @@ class IntroduceGraphStructure(SierpinskiGraphScene):
node = self.nodes[index]
node.save_state()
self.play(
- node.scale_to_fit_height, FRAME_HEIGHT-2,
+ node.set_height, FRAME_HEIGHT-2,
node.next_to, ORIGIN, vect
)
self.wait()
@@ -2990,13 +2990,13 @@ class IntroduceGraphStructure(SierpinskiGraphScene):
for node, vect in zip(nodes, [LEFT, RIGHT]):
node.save_state()
node.generate_target()
- node.target.scale_to_fit_height(5)
+ node.target.set_height(5)
node.target.center()
node.target.to_edge(vect)
arc = Arc(angle = -2*np.pi/3, start_angle = 5*np.pi/6)
if vect is RIGHT:
arc.flip()
- arc.scale_to_fit_width(0.8*node.target.towers.get_width())
+ arc.set_width(0.8*node.target.towers.get_width())
arc.next_to(node.target.towers, UP)
arc.add_tip()
arc.set_color(YELLOW)
@@ -3067,7 +3067,7 @@ class DescribeTriforcePattern(SierpinskiGraphScene):
for node, vect in zip(nodes, [LEFT, RIGHT]):
node.save_state()
node.generate_target()
- node.target.scale_to_fit_height(6)
+ node.target.set_height(6)
node.target.center().next_to(ORIGIN, vect)
self.play(*map(MoveToTarget, nodes))
@@ -3239,7 +3239,7 @@ class MortyLookingAtRectangle(Scene):
url = TextMobject("www.desmos.com/careers")
url.to_corner(UP+LEFT)
rect = Rectangle(height = 9, width = 16)
- rect.scale_to_fit_height(5)
+ rect.set_height(5)
rect.next_to(url, DOWN)
rect.shift_onto_screen()
url.save_state()
diff --git a/old_projects/highD.py b/old_projects/highD.py
index efda89485..ea27a68fa 100644
--- a/old_projects/highD.py
+++ b/old_projects/highD.py
@@ -319,7 +319,7 @@ class MathIsATease(Scene):
for angle in np.linspace(-np.pi/3, np.pi/3, 12):
lash = Line(ORIGIN, RIGHT)
lash.set_stroke(DARK_GREY, 2)
- lash.scale_to_fit_width(0.27)
+ lash.set_width(0.27)
lash.next_to(ORIGIN, RIGHT, buff = 0)
lash.rotate(angle + np.pi/2)
lash.shift(eye.get_center())
@@ -875,7 +875,7 @@ class DismissProjection(PiCreatureScene):
def get_sphere_screen(self, equation, vect):
square = Rectangle()
- square.scale_to_fit_width(equation.get_width())
+ square.set_width(equation.get_width())
square.stretch_to_fit_height(3)
square.next_to(equation, vect)
square.set_color(self.screen_rect_color)
@@ -1736,7 +1736,7 @@ class ThreeDCubeCorners(Scene):
name = TextMobject("Corners: ")
name.next_to(coordinates[0], LEFT)
group = VGroup(name, coordinates)
- group.scale_to_fit_height(FRAME_HEIGHT - 1)
+ group.set_height(FRAME_HEIGHT - 1)
group.to_edge(LEFT)
self.play(Write(name, run_time = 2))
@@ -2840,7 +2840,7 @@ class FiveDBoxExampleWithSliders(FourDBoxExampleWithSliders):
re_rects.generate_target()
for rect, slider in zip(re_rects.target, self.sliders):
height = slider.unit_size*(1-np.sqrt(0.2))
- rect.scale_to_fit_height(height)
+ rect.set_height(height)
rect.move_to(slider.number_to_point(0), DOWN)
self.sphere_words.generate_target()
@@ -3080,7 +3080,7 @@ class ThreeDOuterBoundingBoxWords(Scene):
"$4 \\!\\times\\! 4\\!\\times\\! 4$ outer\\\\",
"bounding box"
)
- words.scale_to_fit_width(FRAME_WIDTH-1)
+ words.set_width(FRAME_WIDTH-1)
words.to_edge(DOWN)
words.set_color(MAROON_B)
@@ -3475,7 +3475,7 @@ class Promotion(PiCreatureScene):
url.to_corner(UP+LEFT)
rect = Rectangle(height = 9, width = 16)
- rect.scale_to_fit_height(5.5)
+ rect.set_height(5.5)
rect.next_to(url, DOWN)
rect.to_edge(LEFT)
diff --git a/old_projects/hilbert/section1.py b/old_projects/hilbert/section1.py
index a2b9c528f..5d797d91f 100644
--- a/old_projects/hilbert/section1.py
+++ b/old_projects/hilbert/section1.py
@@ -346,7 +346,7 @@ class AssociatePixelWithFrequency(Scene):
)
pixel.set_color(WHITE)
pixel_width = big_grid.width/big_grid.columns
- pixel.scale_to_fit_width(pixel_width)
+ pixel.set_width(pixel_width)
pixel.to_corner(UP+RIGHT, buff = 2)
pixel.shift(5*pixel_width*(2*LEFT+DOWN))
@@ -457,10 +457,10 @@ class LayAsideSpeculation(Scene):
def construct(self):
words = TextMobject("Would this actually work?")
grid = get_grid()
- grid.scale_to_fit_width(6)
+ grid.set_width(6)
grid.to_edge(LEFT)
freq_line = get_freq_line()
- freq_line.scale_to_fit_width(6)
+ freq_line.set_width(6)
freq_line.center().to_edge(RIGHT)
mapping = Mobject(
grid, freq_line, Arrow(grid, freq_line)
@@ -481,10 +481,10 @@ class LayAsideSpeculation(Scene):
class RandomMapping(Scene):
def construct(self):
grid = get_grid()
- grid.scale_to_fit_width(6)
+ grid.set_width(6)
grid.to_edge(LEFT)
freq_line = get_freq_line()
- freq_line.scale_to_fit_width(6)
+ freq_line.set_width(6)
freq_line.center().to_edge(RIGHT)
# for mob in grid, freq_line:
# indices = np.arange(mob.get_num_points())
@@ -523,10 +523,10 @@ class LeverageExistingIntuitions(Scene):
class ThinkInTermsOfReverseMapping(Scene):
def construct(self):
grid = get_grid()
- grid.scale_to_fit_width(6)
+ grid.set_width(6)
grid.to_edge(LEFT)
freq_line = get_freq_line()
- freq_line.scale_to_fit_width(6)
+ freq_line.set_width(6)
freq_line.center().to_edge(RIGHT)
arrow = Arrow(grid, freq_line)
diff --git a/old_projects/hilbert/section2.py b/old_projects/hilbert/section2.py
index 55479d504..73291a7a5 100644
--- a/old_projects/hilbert/section2.py
+++ b/old_projects/hilbert/section2.py
@@ -493,7 +493,7 @@ class FormalDefinitionOfContinuity(Scene):
self.output.set_color(GREEN_A)
self.interval = UnitInterval()
- self.interval.scale_to_fit_width(FRAME_X_RADIUS-1)
+ self.interval.set_width(FRAME_X_RADIUS-1)
self.interval.to_edge(LEFT)
self.input_dot = Dot(color = self.input_color)
diff --git a/old_projects/leibniz.py b/old_projects/leibniz.py
index cacc9ced9..4499ae77c 100644
--- a/old_projects/leibniz.py
+++ b/old_projects/leibniz.py
@@ -34,7 +34,7 @@ class LatticePointScene(Scene):
secondary_line_ratio = self.secondary_line_ratio,
radius = self.plane_color
)
- plane.scale_to_fit_height(FRAME_HEIGHT)
+ plane.set_height(FRAME_HEIGHT)
plane.shift(self.plane_center)
self.add(plane)
self.plane = plane
@@ -198,7 +198,7 @@ class Introduction(PiCreatureScene):
self.play(
Write(primes, run_time = 2),
morty.change_mode, "happy",
- video.scale_to_fit_height, FRAME_WIDTH,
+ video.set_height, FRAME_WIDTH,
video.center,
video.set_fill, None, 0
)
@@ -222,7 +222,7 @@ class Introduction(PiCreatureScene):
)
self.wait(2)
self.play(
- plane.scale_to_fit_width, pi_group.get_width(),
+ plane.set_width, pi_group.get_width(),
plane.next_to, pi_group, DOWN, MED_LARGE_BUFF
)
@@ -554,7 +554,7 @@ class Outline(PiCreatureScene):
secondary_line_ratio = 0,
color = BLUE_E,
)
- plane.scale_to_fit_height(6)
+ plane.set_height(6)
plane.next_to(step, DOWN)
plane.to_edge(LEFT)
circle = Circle(
@@ -605,7 +605,7 @@ class Outline(PiCreatureScene):
)
self.wait()
self.play(
- lattice_group.scale_to_fit_height, 2.5,
+ lattice_group.set_height, 2.5,
lattice_group.next_to, self.question, DOWN,
lattice_group.to_edge, RIGHT
)
@@ -636,7 +636,7 @@ class Outline(PiCreatureScene):
value.next_to(arrow, DOWN)
numerators.add(value)
group = VGroup(chis, arrows, numerators)
- group.scale_to_fit_width(1.3*FRAME_X_RADIUS)
+ group.set_width(1.3*FRAME_X_RADIUS)
group.to_corner(DOWN+LEFT)
self.play(FadeIn(self.steps[3]))
@@ -808,7 +808,7 @@ class CountLatticePoints(LatticePointScene):
self.plane.coords_to_point(0, 0),
self.plane.coords_to_point(1, 0),
)
- square.scale_to_fit_width(unit_line.get_width())
+ square.set_width(unit_line.get_width())
squares = VGroup(*[
square.copy().move_to(point)
for point in self.lattice_points
@@ -1078,7 +1078,7 @@ class CountThroughRings(LatticePointScene):
])
top_list.set_color(YELLOW)
top_list.arrange_submobjects(RIGHT, aligned_edge = DOWN)
- top_list.scale_to_fit_width(FRAME_WIDTH - MED_LARGE_BUFF)
+ top_list.set_width(FRAME_WIDTH - MED_LARGE_BUFF)
top_list.to_edge(UP, buff = SMALL_BUFF)
top_rect = BackgroundRectangle(top_list)
@@ -1123,7 +1123,7 @@ class CountThroughRings(LatticePointScene):
)
root = TexMobject("\\sqrt{%d}"%radius_squared)
root.add_background_rectangle()
- root.scale_to_fit_width(
+ root.set_width(
min(0.7*radial_line.get_width(), root.get_width())
)
root.next_to(radial_line, DOWN, SMALL_BUFF)
@@ -1327,7 +1327,7 @@ class Given2DThinkComplex(TeacherStudentsScene):
y_radius = 0.6*FRAME_Y_RADIUS,
)
plane.add_coordinates()
- plane.scale_to_fit_height(FRAME_Y_RADIUS)
+ plane.set_height(FRAME_Y_RADIUS)
plane.to_corner(UP+LEFT)
self.teacher_says(tex)
@@ -1607,7 +1607,7 @@ class IntroduceComplexConjugate(LatticePointScene):
randy.scale(0.8)
randy.to_corner(DOWN+LEFT)
morty = Mortimer()
- morty.scale_to_fit_height(randy.get_height())
+ morty.set_height(randy.get_height())
morty.next_to(randy, RIGHT)
randy.make_eye_contact(morty)
screen = ScreenRectangle(height = 3.5)
@@ -2516,7 +2516,7 @@ class IntroduceRecipe(Scene):
)
max_width = FRAME_WIDTH - 2
if factorization.get_width() > max_width:
- factorization.scale_to_fit_width(max_width)
+ factorization.set_width(max_width)
factorization.next_to(
self.integer_factorization, DOWN,
aligned_edge = LEFT
@@ -3535,7 +3535,7 @@ class IntroduceChi(FactorizationPattern):
value.next_to(arrow, UP)
numbers.add(value)
group = VGroup(chis, arrows, numbers)
- group.scale_to_fit_width(FRAME_WIDTH - LARGE_BUFF)
+ group.set_width(FRAME_WIDTH - LARGE_BUFF)
group.to_edge(DOWN, buff = LARGE_BUFF)
self.play(*[
@@ -3979,7 +3979,7 @@ class ExpandCountWith45(SummarizeCountingRule):
expansion.add(plus)
expansion.add(rp)
expansion.arrange_submobjects(RIGHT, buff = SMALL_BUFF)
- expansion.scale_to_fit_width(FRAME_WIDTH - LARGE_BUFF)
+ expansion.set_width(FRAME_WIDTH - LARGE_BUFF)
expansion.next_to(ORIGIN, UP)
rect = BackgroundRectangle(expansion)
rect.stretch_in_place(1.5, 1)
@@ -4224,7 +4224,7 @@ class CountLatticePointsInBigCircle(LatticePointScene):
TexMobject("\\sqrt{R^2}")
)
radicals.arrange_submobjects(DOWN, buff = MED_SMALL_BUFF)
- radicals.scale_to_fit_height(FRAME_HEIGHT - MED_LARGE_BUFF)
+ radicals.set_height(FRAME_HEIGHT - MED_LARGE_BUFF)
radicals.to_edge(DOWN, buff = MED_SMALL_BUFF)
radicals.to_edge(LEFT)
for radical in radicals:
@@ -4745,7 +4745,7 @@ class Sponsorship(PiCreatureScene):
logo = SVGMobject(
file_name = "remix_logo",
)
- logo.scale_to_fit_height(1)
+ logo.set_height(1)
logo.center()
logo.set_stroke(width = 0)
logo.set_fill(BLUE_D, 1)
@@ -4778,7 +4778,7 @@ class Sponsorship(PiCreatureScene):
class Thumbnail(Scene):
def construct(self):
randy = Randolph()
- randy.scale_to_fit_height(5)
+ randy.set_height(5)
body_copy = randy.body.copy()
body_copy.set_stroke(YELLOW, width = 3)
body_copy.set_fill(opacity = 0)
diff --git a/old_projects/lost_lecture.py b/old_projects/lost_lecture.py
index 1b51c4eb7..ef22211f8 100644
--- a/old_projects/lost_lecture.py
+++ b/old_projects/lost_lecture.py
@@ -117,12 +117,12 @@ class TakeOver(PiCreatureScene):
def construct(self):
gradient = ImageMobject("white_black_gradient")
- gradient.scale_to_fit_height(FRAME_HEIGHT)
+ gradient.set_height(FRAME_HEIGHT)
self.add(gradient)
morty = self.pi_creatures
henry = ImageMobject("Henry_As_Stick")
- henry.scale_to_fit_height(4)
+ henry.set_height(4)
henry.to_edge(LEFT)
henry.to_edge(DOWN)
@@ -329,7 +329,7 @@ class ShowFullStory(Scene):
images.shift(-images[0].get_center())
self.play(
- images.scale_to_fit_width, FRAME_WIDTH - 1,
+ images.set_width, FRAME_WIDTH - 1,
images.center,
run_time=3,
)
@@ -355,10 +355,10 @@ class FeynmanAndOrbitingPlannetOnEllipseDiagram(ShowEmergingEllipse):
e_dot.set_color(YELLOW)
comet = ImageMobject("earth")
- comet.scale_to_fit_width(0.3)
+ comet.set_width(0.3)
feynman = ImageMobject("Feynman")
- feynman.scale_to_fit_height(6)
+ feynman.set_height(6)
feynman.next_to(ORIGIN, LEFT)
feynman.to_edge(UP)
feynman_name = TextMobject("Richard Feynman")
@@ -394,7 +394,7 @@ class FeynmanFame(Scene):
ImageMobject("Feynman_Lectures_cover"),
)
for book in books:
- book.scale_to_fit_height(6)
+ book.set_height(6)
book.move_to(FRAME_WIDTH * LEFT / 4)
feynman_diagram = self.get_feynman_diagram()
@@ -428,14 +428,14 @@ class FeynmanFame(Scene):
safe.add_to_back(safe_rect)
bongo = SVGMobject(file_name="bongo")
- bongo.scale_to_fit_height(1)
+ bongo.set_height(1)
bongo.set_color(WHITE)
bongo.next_to(safe, RIGHT, LARGE_BUFF)
objects = VGroup(safe, bongo)
feynman_smile = ImageMobject("Feynman_Los_Alamos")
- feynman_smile.scale_to_fit_height(4)
+ feynman_smile.set_height(4)
feynman_smile.next_to(objects, DOWN)
VGroup(objects, feynman_smile).next_to(ORIGIN, RIGHT)
@@ -470,7 +470,7 @@ class FeynmanFame(Scene):
# As a teacher
feynman_teacher = ImageMobject("Feynman_teaching")
- feynman_teacher.scale_to_fit_width(FRAME_WIDTH / 2 - 1)
+ feynman_teacher.set_width(FRAME_WIDTH / 2 - 1)
feynman_teacher.next_to(ORIGIN, RIGHT)
self.play(self.get_book_intro(feynman_teacher))
@@ -589,7 +589,7 @@ class TheMotionOfPlanets(Scene):
def setup_orbits(self):
sun = ImageMobject("sun")
- sun.scale_to_fit_height(0.7)
+ sun.set_height(0.7)
planets, ellipses, orbits = self.get_planets_ellipses_and_orbits(sun)
archivist_words = TextMobject(
@@ -603,7 +603,7 @@ class TheMotionOfPlanets(Scene):
alt_name.add_background_rectangle()
book = ImageMobject("Lost_Lecture_cover")
- book.scale_to_fit_height(4)
+ book.set_height(4)
book.next_to(alt_name, DOWN)
self.add(SunAnimation(sun))
@@ -638,7 +638,7 @@ class TheMotionOfPlanets(Scene):
orbit_eccentricies = [0.206, 0.006, 0.0167, 0.0934, 0.967]
for planet, size in zip(planets, sizes):
- planet.scale_to_fit_height(0.5)
+ planet.set_height(0.5)
planet.scale(size)
ellipses = VGroup(*[
@@ -778,7 +778,7 @@ class AskAboutEllipses(TheMotionOfPlanets):
)
max_width = 0.6 * radial_line.get_width()
if new_decimal.get_width() > max_width:
- new_decimal.scale_to_fit_width(max_width)
+ new_decimal.set_width(max_width)
new_decimal.next_to(radial_line, UP, SMALL_BUFF)
VGroup(new_decimal, radial_line).rotate(
-angle, about_point=ORIGIN
@@ -888,7 +888,7 @@ class AskAboutEllipses(TheMotionOfPlanets):
equation = VGroup(d_dt, in_vect, equals, out_vect)
equation.arrange_submobjects(RIGHT, buff=SMALL_BUFF)
- equation.scale_to_fit_width(6)
+ equation.set_width(6)
equation.to_corner(DR, buff=MED_LARGE_BUFF)
cross = Cross(equation)
@@ -901,7 +901,7 @@ class AskAboutEllipses(TheMotionOfPlanets):
# Helpers
def get_comet(self):
comet = ImageMobject("comet")
- comet.scale_to_fit_height(self.comet_height)
+ comet.set_height(self.comet_height)
return comet
def get_ellipse(self):
@@ -1002,7 +1002,7 @@ class FeynmanElementaryQuote(Scene):
alignment=""
)
quote[-1].shift(2 * SMALL_BUFF * LEFT)
- quote.scale_to_fit_width(FRAME_WIDTH - 1)
+ quote.set_width(FRAME_WIDTH - 1)
quote.to_edge(UP)
quote.get_part_by_tex("of").set_color(WHITE)
@@ -1038,7 +1038,7 @@ class FeynmanElementaryQuote(Scene):
ImageMobject("Fourier_Thumbnail"),
)
for image in images:
- image.scale_to_fit_height(3)
+ image.set_height(3)
images.arrange_submobjects(RIGHT, buff=LARGE_BUFF)
images.to_edge(DOWN, buff=LARGE_BUFF)
images[1].move_to(images[0])
@@ -1075,7 +1075,7 @@ class LostLecturePicture(TODOStub):
def construct(self):
picture = ImageMobject("Feynman_teaching")
- picture.scale_to_fit_height(FRAME_WIDTH)
+ picture.set_height(FRAME_WIDTH)
picture.to_corner(UL, buff=0)
picture.fade(0.5)
@@ -1163,7 +1163,7 @@ class DrawEllipseOverlay(Scene):
"HeldUpEllipse.jpg"
)
)
- image.scale_to_fit_height(FRAME_HEIGHT)
+ image.set_height(FRAME_HEIGHT)
# self.add(image)
self.play(ShowCreation(ellipse))
@@ -1346,7 +1346,7 @@ class ShowEllipseDefiningProperty(Scene):
""",
alignment="",
)
- footnote.scale_to_fit_width(5)
+ footnote.set_width(5)
footnote.to_corner(DR)
footnote.set_stroke(WHITE, 0.5)
@@ -1405,7 +1405,7 @@ class ShowEllipseDefiningProperty(Scene):
)
max_width = 0.6 * line.get_width()
if new_decimal.get_width() > max_width:
- new_decimal.scale_to_fit_width(max_width)
+ new_decimal.set_width(max_width)
new_decimal.next_to(line, UP, SMALL_BUFF)
new_decimal.set_color(color)
new_decimal.add_to_back(
@@ -1501,7 +1501,7 @@ class GeometryProofLand(Scene):
word.shift(3 * RIGHT)
word.apply_complex_function(np.exp)
word.rotate(90 * DEGREES)
- word.scale_to_fit_width(9)
+ word.set_width(9)
word.center()
word.to_edge(UP)
word.set_color_by_gradient(*self.colors)
@@ -2058,7 +2058,7 @@ class ProveEllipse(ShowEmergingEllipse, ShowEllipseDefiningProperty):
ellipse = self.ellipse
ep_dot = self.ep_dot
planet = ImageMobject("earth")
- planet.scale_to_fit_height(0.25)
+ planet.set_height(0.25)
orbit = Orbiting(planet, ep_dot, ellipse)
lines = self.lines
@@ -2323,7 +2323,7 @@ class KeplersSecondLaw(AskAboutEllipses):
)
min_width = 0.8 * radius.get_length()
if radius_words.get_width() > min_width:
- radius_words.scale_to_fit_width(min_width)
+ radius_words.set_width(min_width)
radius_words.match_color(radius)
radius_words.next_to(ORIGIN, UP, SMALL_BUFF)
angle = radius.get_angle()
@@ -2378,7 +2378,7 @@ class NonEllipticalKeplersLaw(KeplersSecondLaw):
0
])
)
- orbit_shape.scale_to_fit_height(7)
+ orbit_shape.set_height(7)
orbit_shape.stretch(1.5, 0)
orbit_shape.shift(LEFT)
orbit_shape.set_stroke(LIGHT_GREY, 1)
@@ -2736,13 +2736,13 @@ class FeynmanRecountingNewton(Scene):
def construct(self):
feynman_teaching = ImageMobject("Feynman_teaching")
- feynman_teaching.scale_to_fit_width(FRAME_WIDTH)
+ feynman_teaching.set_width(FRAME_WIDTH)
newton = ImageMobject("Newton")
principia = ImageMobject("Principia_equal_area")
images = [newton, principia]
for image in images:
- image.scale_to_fit_height(5)
+ image.set_height(5)
newton.to_corner(UL)
principia.next_to(newton, RIGHT)
for image in images:
@@ -4197,7 +4197,7 @@ class PatYourselfOnTheBack(TeacherStudentsScene):
feynman = ImageMobject("Feynman", height=4)
feynman.to_corner(UL)
chess = ImageMobject("ChessGameOfTheCentury")
- chess.scale_to_fit_height(4)
+ chess.set_height(4)
chess.next_to(feynman)
self.play(FadeInFromDown(feynman))
@@ -4216,7 +4216,7 @@ class Thumbnail(ShowEmergingEllipse):
def construct(self):
background = ImageMobject("Feynman_teaching")
- background.scale_to_fit_width(FRAME_WIDTH)
+ background.set_width(FRAME_WIDTH)
background.scale(1.05)
background.to_corner(UR, buff=0)
background.shift(2 * UP)
@@ -4225,7 +4225,7 @@ class Thumbnail(ShowEmergingEllipse):
circle = self.get_circle()
circle.set_stroke(width=6)
- circle.scale_to_fit_height(6.5)
+ circle.set_height(6.5)
circle.to_corner(UL)
circle.set_fill(BLACK, 0.9)
lines = self.get_lines()
diff --git a/old_projects/mug.py b/old_projects/mug.py
index 8ecd3832d..7f96ae48c 100644
--- a/old_projects/mug.py
+++ b/old_projects/mug.py
@@ -83,7 +83,7 @@ class UtilitiesPuzzleScene(Scene):
houses = VGroup()
for x in range(3):
house = SVGMobject(file_name = "house")
- house.scale_to_fit_height(self.object_height)
+ house.set_height(self.object_height)
house.set_fill(LIGHT_GREY)
house.move_to(x*self.h_distance*RIGHT)
houses.add(house)
@@ -125,7 +125,7 @@ class UtilitiesPuzzleScene(Scene):
utility.set_fill(DARK_GREY)
utility.move_to(circle)
circle.add(utility)
- circle.scale_to_fit_height(self.object_height)
+ circle.set_height(self.object_height)
return circle
def get_line(
@@ -267,7 +267,7 @@ class AboutToyPuzzles(UtilitiesPuzzleScene, TeacherStudentsScene, ThreeDScene):
cube = Cube()
cube.set_stroke(WHITE, 2)
- cube.scale_to_fit_height(0.75)
+ cube.set_height(0.75)
cube.pose_at_angle()
cube.next_to(eulers, UP)
@@ -362,7 +362,7 @@ class ThisPuzzleIsHard(UtilitiesPuzzleScene, PiCreatureScene):
self.play(
LaggedStart(DrawBorderThenFill, houses),
LaggedStart(GrowFromCenter, utilities),
- try_it.scale_to_fit_width, house.get_width(),
+ try_it.set_width, house.get_width(),
try_it.fade, 1,
try_it.move_to, house,
self.pi_creature.change, "happy",
@@ -1209,7 +1209,7 @@ class LightUpNodes(IntroduceRegions):
stroke_width = 0,
stroke_color = BLACK,
)
- line.scale_to_fit_width(0.5*vertex.get_width())
+ line.set_width(0.5*vertex.get_width())
line.next_to(ORIGIN, buff = 0.75*vertex.get_width())
lines = VGroup(*[
line.copy().rotate(angle)
@@ -1329,7 +1329,7 @@ class ConcludeFiveRegions(LightUpNodes):
lines.generate_target()
for line in lines.target:
line.rotate(-line.get_angle())
- line.scale_to_fit_width(1.5)
+ line.set_width(1.5)
lines.target.arrange_submobjects(DOWN)
line_sets.target.add(lines.target)
line_sets.target.arrange_submobjects(DOWN)
diff --git a/old_projects/name_animation.py b/old_projects/name_animation.py
index c66020a59..40131d3f8 100644
--- a/old_projects/name_animation.py
+++ b/old_projects/name_animation.py
@@ -20,7 +20,7 @@ class NameAnimationScene(Scene):
letter_mobs = TextMobject(name)
nb_letters = len(letter_mobs)
randy = PiCreature()
- randy.move_to(ORIGIN).scale_to_fit_height(0.5 * DIAMETER)
+ randy.move_to(ORIGIN).set_height(0.5 * DIAMETER)
randy.set_color(BLUE_E)
randy.look_at(UP + RIGHT)
self.add(randy)
diff --git a/old_projects/nn/part1.py b/old_projects/nn/part1.py
index 1dd1e96b4..2863c0e4a 100644
--- a/old_projects/nn/part1.py
+++ b/old_projects/nn/part1.py
@@ -244,7 +244,7 @@ class NetworkMobject(VGroup):
self.output_labels = VGroup()
for n, neuron in enumerate(self.layers[-1].neurons):
label = TexMobject(str(n))
- label.scale_to_fit_height(0.75*neuron.get_height())
+ label.set_height(0.75*neuron.get_height())
label.move_to(neuron)
label.shift(neuron.get_width()*RIGHT)
self.output_labels.add(label)
@@ -347,12 +347,12 @@ class ExampleThrees(PiCreatureScene):
bubble = randy.get_bubble(height = 4, width = 6)
three_mob.generate_target()
- three_mob.target.scale_to_fit_height(1)
+ three_mob.target.set_height(1)
three_mob.target.next_to(bubble[-1].get_left(), RIGHT, LARGE_BUFF)
arrow = Arrow(LEFT, RIGHT, color = BLUE)
arrow.next_to(three_mob.target, RIGHT)
real_three = TexMobject("3")
- real_three.scale_to_fit_height(0.8)
+ real_three.set_height(0.8)
real_three.next_to(arrow, RIGHT)
self.play(
@@ -407,7 +407,7 @@ class ExampleThrees(PiCreatureScene):
alt_threes = VGroup(*self.three_mobs[1:])
alt_threes.arrange_submobjects(DOWN)
- alt_threes.scale_to_fit_height(FRAME_HEIGHT - 2)
+ alt_threes.set_height(FRAME_HEIGHT - 2)
alt_threes.to_edge(RIGHT)
for alt_three in alt_threes:
@@ -452,7 +452,7 @@ class ExampleThrees(PiCreatureScene):
equals.move_to(self.arrow)
for three, vect in (left_three, LEFT), (right_three, RIGHT):
three.generate_target()
- three.target.scale_to_fit_height(1)
+ three.target.set_height(1)
three.target.next_to(equals, vect)
self.play(
@@ -518,7 +518,7 @@ class ExampleThrees(PiCreatureScene):
class BrainAndHow(Scene):
def construct(self):
brain = SVGMobject(file_name = "brain")
- brain.scale_to_fit_height(2)
+ brain.set_height(2)
brain.set_fill(LIGHT_GREY)
brain_outline = brain.copy()
brain_outline.set_fill(opacity = 0)
@@ -546,7 +546,7 @@ class WriteAProgram(Scene):
im_mob = ImageMobject(layer_to_image_array(three_array))
three = PixelsAsSquares(im_mob)
three.sort_submobjects(lambda p : np.dot(p, DOWN+RIGHT))
- three.scale_to_fit_height(6)
+ three.set_height(6)
three.next_to(ORIGIN, LEFT)
three_rect = SurroundingRectangle(
three,
@@ -564,7 +564,7 @@ class WriteAProgram(Scene):
num.set_stroke(width = 1)
color = rgba_to_color(1 - (rgb + 0.2)/1.2)
num.set_color(color)
- num.scale_to_fit_width(0.7*square.get_width())
+ num.set_width(0.7*square.get_width())
num.move_to(square)
numbers.add(num)
@@ -573,7 +573,7 @@ class WriteAProgram(Scene):
choices = VGroup(*[TexMobject(str(n)) for n in range(10)])
choices.arrange_submobjects(DOWN)
- choices.scale_to_fit_height(FRAME_HEIGHT - 1)
+ choices.set_height(FRAME_HEIGHT - 1)
choices.next_to(arrow, RIGHT)
self.play(
@@ -747,12 +747,12 @@ class LayOutPlan(TeacherStudentsScene, NetworkScene):
VideoIcon().set_fill(RED)
for x in range(2)
])
- videos.scale_to_fit_height(1.5)
+ videos.set_height(1.5)
videos.arrange_submobjects(RIGHT, buff = LARGE_BUFF)
videos.next_to(self.students, UP, LARGE_BUFF)
network_mob.generate_target()
- network_mob.target.scale_to_fit_height(0.8*videos[0].get_height())
+ network_mob.target.set_height(0.8*videos[0].get_height())
network_mob.target.move_to(videos[0])
learning.generate_target()
learning.target.next_to(videos[1], UP)
@@ -854,7 +854,7 @@ class AlternateNeuralNetworks(PiCreatureScene):
ex[0].next_to(arrow, LEFT)
ex[1].next_to(arrow, RIGHT)
ex.submobjects.insert(1, arrow)
- examples.scale_to_fit_width(FRAME_WIDTH - 1)
+ examples.set_width(FRAME_WIDTH - 1)
examples.next_to(morty, UP).to_edge(RIGHT)
maybe_words = TextMobject("Maybe future videos?")
@@ -946,7 +946,7 @@ class BreakDownName(Scene):
self.add(name)
self.play(randy.change, "pondering")
self.play(
- brain.scale_to_fit_height, 2,
+ brain.set_height, 2,
brain.shift, 2*UP,
brain.set_fill, None, 1,
randy.look, UP
@@ -996,7 +996,7 @@ class BreakDownName(Scene):
neuron = Circle(radius = 0.35, color = BLUE)
neuron.next_to(neuron_word, UP, MED_LARGE_BUFF)
num = TexMobject("0.2")
- num.scale_to_fit_width(0.7*neuron.get_width())
+ num.set_width(0.7*neuron.get_width())
num.move_to(neuron)
num.save_state()
num.move_to(description.get_right())
@@ -1052,7 +1052,7 @@ class IntroduceEachLayer(PreviewMNistNetwork):
self.image_map = get_organized_images()
image = self.image_map[9][0]
image_mob = PixelsFromVect(image)
- image_mob.scale_to_fit_height(4)
+ image_mob.set_height(4)
image_mob.next_to(ORIGIN, LEFT)
rect = SurroundingRectangle(image_mob, color = BLUE)
neurons = VGroup()
@@ -1114,7 +1114,7 @@ class IntroduceEachLayer(PreviewMNistNetwork):
for neuron in neurons:
o = neuron.get_fill_opacity()
num = DecimalNumber(o, num_decimal_places = 1)
- num.scale_to_fit_width(0.7*neuron.get_width())
+ num.set_width(0.7*neuron.get_width())
num.move_to(neuron)
if o > 0.8:
num.set_fill(BLACK)
@@ -1125,7 +1125,7 @@ class IntroduceEachLayer(PreviewMNistNetwork):
example_neuron.save_state()
example_num.save_state()
example_neuron.generate_target()
- example_neuron.target.scale_to_fit_height(1.5)
+ example_neuron.target.set_height(1.5)
example_neuron.target.next_to(neurons, RIGHT)
example_num.target = DecimalNumber(
example_neuron.get_fill_opacity()
@@ -1300,7 +1300,7 @@ class IntroduceEachLayer(PreviewMNistNetwork):
for layer in hidden_layers:
for neuron in layer.neurons:
q_mark = TextMobject("?")
- q_mark.scale_to_fit_height(0.8*neuron.get_height())
+ q_mark.set_height(0.8*neuron.get_height())
q_mark.move_to(neuron)
q_marks.add(q_mark)
q_marks.set_color_by_gradient(BLUE, YELLOW)
@@ -1332,7 +1332,7 @@ class DiscussChoiceForHiddenLayers(TeacherStudentsScene):
layer_to_layer_buff = 2.5,
neuron_stroke_color = WHITE,
)
- network_mob.scale_to_fit_height(4)
+ network_mob.set_height(4)
network_mob.to_edge(UP, buff = LARGE_BUFF)
layers = VGroup(*network_mob.layers[1:3])
rects = VGroup(*map(SurroundingRectangle, layers))
@@ -1646,7 +1646,7 @@ class BreakUpMacroPatterns(IntroduceEachLayer):
layer = network_mob.layers[-2]
patterns.generate_target()
for pattern, neuron in zip(patterns.target, layer.neurons):
- pattern.scale_to_fit_height(neuron.get_height())
+ pattern.set_height(neuron.get_height())
pattern.next_to(neuron, RIGHT, SMALL_BUFF)
for pattern in patterns[5:]:
pattern.fade(1)
@@ -1795,7 +1795,7 @@ class BreakUpMicroPatterns(BreakUpMacroPatterns):
edge.save_state()
edge[1].set_opacity(0)
equation = self.get_equation(loop.target, *edges.target)
- equation.scale_to_fit_width(FRAME_WIDTH - 1)
+ equation.set_width(FRAME_WIDTH - 1)
equation.to_edge(UP)
symbols = VGroup(*equation[1::2])
@@ -1839,7 +1839,7 @@ class BreakUpMicroPatterns(BreakUpMacroPatterns):
for mob in edge:
mob.set_color(color)
equation = self.get_equation(line, *edges)
- equation.scale_to_fit_height(self.loop_equation.get_height())
+ equation.set_height(self.loop_equation.get_height())
equation.next_to(
self.loop_equation, DOWN, MED_LARGE_BUFF, LEFT
)
@@ -1899,7 +1899,7 @@ class SecondLayerIsLittleEdgeLayer(IntroduceEachLayer):
for im in images
]
self.nine = MNistMobject(nine_array.flatten())
- self.nine.scale_to_fit_height(1.5)
+ self.nine.set_height(1.5)
self.nine[0].set_color(WHITE)
make_transparent(self.nine[1])
self.nine.next_to(layers[0].neurons, UP)
@@ -1980,7 +1980,7 @@ class SecondLayerIsLittleEdgeLayer(IntroduceEachLayer):
neuron.rotate(3*np.pi/4)
neuron.move_to(pixel)
neurons.add(neuron)
- neurons.scale_to_fit_height(2)
+ neurons.set_height(2)
neurons.space_out_submobjects(1.2)
neurons.next_to(network_mob, LEFT)
self.set_neurons_target(neurons, layers[0])
@@ -2088,7 +2088,7 @@ class EdgeDetection(Scene):
edges_array = get_edges(lion.pixel_array)
edges = ImageMobject(edges_array)
group = Group(lion, edges)
- group.scale_to_fit_height(4)
+ group.set_height(4)
group.arrange_submobjects(RIGHT)
lion_copy = lion.copy()
@@ -2122,7 +2122,7 @@ class ManyTasksBreakDownLikeThis(TeacherStudentsScene):
word
)
sequence.arrange_submobjects(RIGHT)
- sequence.scale_to_fit_width(FRAME_WIDTH - 1)
+ sequence.set_width(FRAME_WIDTH - 1)
sequence.to_edge(UP)
audio_label.next_to(audio, DOWN)
@@ -2182,7 +2182,7 @@ class ManyTasksBreakDownLikeThis(TeacherStudentsScene):
])
result.set_stroke(width = 2)
result.arrange_submobjects(RIGHT, buff = MED_SMALL_BUFF)
- result.scale_to_fit_height(1)
+ result.set_height(1)
return result
@@ -2269,7 +2269,7 @@ class IntroduceWeights(IntroduceEachLayer):
))
pixels.set_stroke(width = 0.5)
pixels.set_fill(WHITE, 0)
- pixels.scale_to_fit_height(4)
+ pixels.set_height(4)
pixels.next_to(neuron, RIGHT, LARGE_BUFF)
rect = SurroundingRectangle(pixels, color = BLUE)
@@ -2344,7 +2344,7 @@ class IntroduceWeights(IntroduceEachLayer):
self.play(
Write(question, run_time = 2),
GrowFromPoint(arrow, arrow.get_start()),
- pixels_group.scale_to_fit_height, 3,
+ pixels_group.set_height, 3,
pixels_group.to_edge, RIGHT,
LaggedStart(FadeIn, p_labels),
LaggedStart(FadeIn, decimals),
@@ -2787,7 +2787,7 @@ class IncludeBias(IntroduceWeights):
digit = self.get_digit()
rect = SurroundingRectangle(digit)
d_group = VGroup(digit, rect)
- d_group.scale_to_fit_height(3)
+ d_group.set_height(3)
d_group.to_edge(RIGHT)
weight_grid = digit.copy()
weight_grid.set_fill(BLACK, 0.5)
@@ -2951,7 +2951,7 @@ class BiasForInactiviyWords(Scene):
def construct(self):
words = TextMobject("Bias for inactivity")
words.set_color(BLUE)
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
words.to_edge(UP)
self.play(Write(words))
@@ -3868,7 +3868,7 @@ class IntroduceWeightMatrix(NetworkScene):
def get_brackets(self, mob):
lb, rb = both = TexMobject("\\big[\\big]")
- both.scale_to_fit_width(mob.get_width())
+ both.set_width(mob.get_width())
both.stretch_to_fit_height(1.2*mob.get_height())
lb.next_to(mob, LEFT, SMALL_BUFF)
rb.next_to(mob, RIGHT, SMALL_BUFF)
@@ -3900,7 +3900,7 @@ class SigmoidAppliedToVector(Scene):
\\sigma(x) \\\\ \\sigma(y) \\\\ \\sigma(z)
\\end{array}\\right]
""")
- tex.scale_to_fit_width(FRAME_WIDTH - 1)
+ tex.set_width(FRAME_WIDTH - 1)
tex.to_edge(DOWN)
indices = it.chain(
[0], range(1, 5), range(16, 16+4),
@@ -3982,7 +3982,7 @@ class NeuronIsFunction(MoreHonestMNistNetworkPreview):
neuron = self.network_mob.layers[2].neurons[2]
decimal = DecimalNumber(neuron.get_fill_opacity())
- decimal.scale_to_fit_width(0.7*neuron.get_width())
+ decimal.set_width(0.7*neuron.get_width())
decimal.move_to(neuron)
neuron_group = VGroup(neuron, decimal)
neuron_group.save_state()
@@ -4158,7 +4158,7 @@ class NextVideo(MoreHonestMNistNetworkPreview, PiCreatureScene):
data_mobs = VGroup()
for vect, num in test_data[:30]:
image = MNistMobject(vect)
- image.scale_to_fit_height(0.7)
+ image.set_height(0.7)
arrow = Arrow(ORIGIN, RIGHT, color = BLUE)
num_mob = TexMobject(str(num))
group = Group(image, arrow, num_mob)
@@ -4184,7 +4184,7 @@ class NextVideo(MoreHonestMNistNetworkPreview, PiCreatureScene):
content = self.content
video = VideoIcon()
- video.scale_to_fit_height(3)
+ video.set_height(3)
video.set_fill(RED, 0.8)
video.next_to(morty, UP+LEFT)
@@ -4198,7 +4198,7 @@ class NextVideo(MoreHonestMNistNetworkPreview, PiCreatureScene):
if self.edge_update.internal_time < 1:
self.edge_update.internal_time = 2
self.play(
- content.scale_to_fit_height, 0.8*video.get_height(),
+ content.set_height, 0.8*video.get_height(),
content.move_to, video,
morty.change, "raise_right_hand",
FadeIn(rect),
@@ -4251,14 +4251,14 @@ class NextVideo(MoreHonestMNistNetworkPreview, PiCreatureScene):
network_mob, rect, video, words = self.video
network_mob.generate_target(use_deepcopy = True)
- network_mob.target.scale_to_fit_height(5)
+ network_mob.target.set_height(5)
network_mob.target.to_corner(UP+LEFT)
neurons = VGroup(*network_mob.target.layers[-1].neurons[:2])
neurons.set_stroke(width = 0)
video.generate_target()
video.target.set_fill(opacity = 1)
- video.target.scale_to_fit_height(neurons.get_height())
+ video.target.set_height(neurons.get_height())
video.target.move_to(neurons, LEFT)
self.play(
@@ -4557,7 +4557,7 @@ class Thumbnail(NetworkScene):
}
def construct(self):
network_mob = self.network_mob
- network_mob.scale_to_fit_height(FRAME_HEIGHT - 1)
+ network_mob.set_height(FRAME_HEIGHT - 1)
for layer in network_mob.layers:
layer.neurons.set_stroke(width = 5)
diff --git a/old_projects/nn/part2.py b/old_projects/nn/part2.py
index 4eb0e043c..0882f5930 100644
--- a/old_projects/nn/part2.py
+++ b/old_projects/nn/part2.py
@@ -13,7 +13,7 @@ NEGATIVE_COLOR = RED
def get_training_image_group(train_in, train_out):
image = MNistMobject(train_in)
- image.scale_to_fit_height(1)
+ image.set_height(1)
arrow = Vector(RIGHT, color = BLUE, buff = 0)
output = np.argmax(train_out)
output_tex = TexMobject(str(output)).scale(1.5)
@@ -58,7 +58,7 @@ def get_decimal_vector(nums, with_dots = True):
class ShowLastVideo(TeacherStudentsScene):
def construct(self):
frame = ScreenRectangle()
- frame.scale_to_fit_height(4.5)
+ frame.set_height(4.5)
frame.to_corner(UP+LEFT)
title = TextMobject("But what \\emph{is} a Neural Network")
title.move_to(frame)
@@ -324,7 +324,7 @@ class PreviewLearning(NetworkScene):
class BackpropComingLaterWords(Scene):
def construct(self):
words = TextMobject("(Backpropagation be \\\\ the next video)")
- words.scale_to_fit_width(FRAME_WIDTH-1)
+ words.set_width(FRAME_WIDTH-1)
words.to_edge(DOWN)
self.add(words)
@@ -469,7 +469,7 @@ class MNistDescription(Scene):
group.arrange_submobjects_in_grid(
n_rows = self.n_rows_per_grid,
)
- group.scale_to_fit_height(FRAME_HEIGHT - 1)
+ group.set_height(FRAME_HEIGHT - 1)
if i == 0:
self.play(
LaggedStart(FadeIn, group),
@@ -908,7 +908,7 @@ class IntroduceCostFunction(PreviewLearning):
DOWN, buff = SMALL_BUFF,
aligned_edge = LEFT
)
- terms.scale_to_fit_height(1.5*layer.get_height())
+ terms.set_height(1.5*layer.get_height())
terms.next_to(layer, LEFT, buff = 2)
image_group = Group(self.image, self.image_rect)
@@ -964,7 +964,7 @@ class IntroduceCostFunction(PreviewLearning):
term_updates = []
for arrow, d1, d2 in zip(arrows, *self.decimal_groups):
term = DecimalNumber(0, num_decimal_places = 4)
- term.scale_to_fit_height(d1.get_height())
+ term.set_height(d1.get_height())
term.next_to(arrow, LEFT)
term.num_update_func = generate_term_update_func(d1, d2)
terms.add(term)
@@ -1110,7 +1110,7 @@ class IntroduceCostFunction(PreviewLearning):
for n in num_vect
])
decimals.arrange_submobjects(DOWN)
- decimals.scale_to_fit_height(height)
+ decimals.set_height(height)
lb, rb = brackets = TexMobject("[]")
brackets.scale(2)
brackets.stretch_to_fit_height(height + SMALL_BUFF)
@@ -1225,7 +1225,7 @@ class EmphasizeComplexityOfCostFunction(IntroduceCostFunction):
def setup_sides(self):
v_line = Line(UP, DOWN).scale(FRAME_Y_RADIUS)
network_mob = self.network_mob
- network_mob.scale_to_fit_width(FRAME_X_RADIUS - 1)
+ network_mob.set_width(FRAME_X_RADIUS - 1)
network_mob.to_corner(DOWN+LEFT)
self.add(v_line)
@@ -1252,7 +1252,7 @@ class EmphasizeComplexityOfCostFunction(IntroduceCostFunction):
in_vect = get_organized_images()[7][8]
activations = self.network.get_activation_of_all_layers(in_vect)
image = MNistMobject(in_vect)
- image.scale_to_fit_height(1.5)
+ image.set_height(1.5)
image_label = TextMobject("Input")
image_label.set_color(input_words[0].get_color())
image_label.next_to(image, UP, SMALL_BUFF)
@@ -1394,11 +1394,11 @@ class EmphasizeComplexityOfCostFunction(IntroduceCostFunction):
def get_training_pair_mob(self, data):
in_vect, out_vect = data
image = MNistMobject(in_vect)
- image.scale_to_fit_height(1)
+ image.set_height(1)
comma = TextMobject(",")
comma.next_to(image, RIGHT, SMALL_BUFF, DOWN)
output = TexMobject(str(np.argmax(out_vect)))
- output.scale_to_fit_height(0.75)
+ output.set_height(0.75)
output.next_to(image, RIGHT, MED_SMALL_BUFF)
lp, rp = parens = TextMobject("()")
parens.scale(2)
@@ -1952,7 +1952,7 @@ class GradientDescentAlgorithm(Scene):
TextMobject("Repeat."),
)
words.arrange_submobjects(DOWN, aligned_edge = LEFT)
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
words.to_corner(DOWN+LEFT)
for word in words[:2]:
@@ -1966,7 +1966,7 @@ class GradientDescentName(Scene):
def construct(self):
words = TextMobject("Gradient descent")
words.set_color(BLUE)
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
words.to_edge(DOWN)
self.play(Write(words, run_time = 2))
@@ -2088,7 +2088,7 @@ class ShowFullCostFunctionGradient(PreviewLearning):
class DotsInsert(Scene):
def construct(self):
dots = TexMobject("\\vdots")
- dots.scale_to_fit_height(FRAME_HEIGHT - 1)
+ dots.set_height(FRAME_HEIGHT - 1)
self.add(dots)
class HowMinimizingCostMeansBetterTrainingPerformance(IntroduceCostFunction):
@@ -2193,7 +2193,7 @@ class NonSpatialGradientIntuition(Scene):
rb.next_to(ws, RIGHT)
vect = VGroup(lb, ws, rb)
- vect.scale_to_fit_height(self.vect_height)
+ vect.set_height(self.vect_height)
vect.to_edge(UP).shift(2*LEFT)
lhs.next_to(vect, LEFT)
@@ -2231,7 +2231,7 @@ class NonSpatialGradientIntuition(Scene):
))
grad_vect = VGroup(lb.copy(), grad_content, rb.copy())
VGroup(grad_vect[0], grad_vect[-1]).space_out_submobjects(0.8)
- grad_vect.scale_to_fit_height(self.vect_height)
+ grad_vect.set_height(self.vect_height)
grad_vect.next_to(self.vect, DOWN)
lhs.next_to(grad_vect, LEFT)
@@ -2737,13 +2737,13 @@ class ContinuouslyRangingNeuron(PreviewLearning):
network_mob.to_edge(DOWN)
neuron = self.network_mob.layers[2].neurons[6]
decimal = DecimalNumber(0)
- decimal.scale_to_fit_width(0.8*neuron.get_width())
+ decimal.set_width(0.8*neuron.get_width())
decimal.move_to(neuron)
decimal.generate_target()
neuron.generate_target()
group = VGroup(neuron.target, decimal.target)
- group.scale_to_fit_height(1)
+ group.set_height(1)
group.next_to(network_mob, UP)
decimal.set_fill(opacity = 0)
@@ -2792,7 +2792,7 @@ class TestPerformance(PreviewLearning):
self.run_through_examples()
def setup_network_mob(self):
- self.network_mob.scale_to_fit_height(5)
+ self.network_mob.set_height(5)
self.network_mob.to_corner(DOWN+LEFT)
self.network_mob.to_edge(DOWN, buff = MED_SMALL_BUFF)
@@ -2854,7 +2854,7 @@ class TestPerformance(PreviewLearning):
choice = np.argmax(activations[-1])
image = MNistMobject(test_in)
- image.scale_to_fit_height(1.5)
+ image.set_height(1.5)
choice_mob = TexMobject(str(choice))
choice_mob.scale(1.5)
group = VGroup(image, arrow, choice_mob)
@@ -2984,7 +2984,7 @@ class NotAtAll(TeacherStudentsScene, PreviewLearning):
words = TextMobject("Well...\\\\", "not at all!")
words[1].set_color(BLACK)
network_mob = self.network_mob
- network_mob.scale_to_fit_height(4)
+ network_mob.set_height(4)
network_mob.to_corner(UP+LEFT)
self.add(network_mob)
self.color_network_edges()
@@ -3045,7 +3045,7 @@ class InterpretFirstWeightMatrixRows(TestPerformance):
pixel.set_fill(color, opacity = abs(shade)**(0.3))
pixel_arrays.add(pixel_array)
pixel_arrays.arrange_submobjects_in_grid(buff = MED_LARGE_BUFF)
- pixel_arrays.scale_to_fit_height(FRAME_HEIGHT - 2.5)
+ pixel_arrays.set_height(FRAME_HEIGHT - 2.5)
pixel_arrays.to_corner(DOWN+RIGHT)
for pixel_array in pixel_arrays:
@@ -3375,7 +3375,7 @@ class SomethingToImproveUpon(PiCreatureScene, TestPerformance):
for v_in, choice in validation_data[:self.n_examples]:
image = MNistMobject(v_in)
- image.scale_to_fit_height(1)
+ image.set_height(1)
choice = TexMobject(str(choice))
choice.scale(2)
arrow = Vector(RIGHT, color = WHITE)
@@ -3456,7 +3456,7 @@ class ConvolutionalNetworkPreview(Scene):
vect = get_organized_images()[9][0]
image = PixelsFromVect(vect)
image.set_stroke(width = 1)
- image.scale_to_fit_height(FRAME_HEIGHT - 1)
+ image.set_height(FRAME_HEIGHT - 1)
self.add(image)
kernels = [
@@ -3543,7 +3543,7 @@ class RandomlyLabeledImageData(Scene):
def get_training_group(self, image_name, label_name):
arrow = Vector(RIGHT, color = WHITE)
image = ImageMobject(image_name)
- image.scale_to_fit_height(1.3)
+ image.set_height(1.3)
image.next_to(arrow, LEFT)
label = TextMobject(label_name)
label.next_to(arrow, RIGHT)
@@ -3593,7 +3593,7 @@ class TrainOnImages(PreviewLearning, RandomlyLabeledImageData):
self.remove(group)
def setup_network_mob(self):
- self.network_mob.scale_to_fit_height(5)
+ self.network_mob.set_height(5)
self.network_mob.to_edge(DOWN)
self.color_network_edges()
@@ -3698,7 +3698,7 @@ class ManyMinimaWords(Scene):
"Many local minima,\\\\",
"roughly equal quality"
)
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
words.to_edge(UP)
self.play(Write(words))
self.wait()
diff --git a/old_projects/nn/part3.py b/old_projects/nn/part3.py
index f5c38f84e..3605801a6 100644
--- a/old_projects/nn/part3.py
+++ b/old_projects/nn/part3.py
@@ -19,7 +19,7 @@ class LayOutPlan(Scene):
self.add(items)
rect = ScreenRectangle()
- rect.scale_to_fit_width(FRAME_WIDTH - items.get_width() - 2)
+ rect.set_width(FRAME_WIDTH - items.get_width() - 2)
rect.next_to(items, RIGHT, MED_LARGE_BUFF)
self.play(
@@ -306,7 +306,7 @@ class InterpretGradientComponents(GradientNudging):
grad_terms.generate_target()
grad_terms.target[len(grad_terms)/2].rotate(np.pi/2)
grad_terms.target.arrange_submobjects(RIGHT)
- grad_terms.target.scale_to_fit_width(cost_expression.get_width())
+ grad_terms.target.set_width(cost_expression.get_width())
grad_terms.target.next_to(cost_expression, DOWN)
words = TextMobject("Nudge weights")
@@ -522,7 +522,7 @@ class ShowAveragingCost(PreviewLearning):
if hasattr(self, "curr_image"):
self.remove(self.curr_image)
image = MNistMobject(train_in)
- image.scale_to_fit_height(self.image_height)
+ image.set_height(self.image_height)
image.next_to(
self.network_mob.layers[0].neurons, UP,
aligned_edge = LEFT
@@ -672,7 +672,7 @@ class WalkThroughTwoExample(ShowAveragingCost):
for neuron in neurons:
activation = neuron.get_fill_opacity()
decimal = DecimalNumber(activation, num_decimal_places = 1)
- decimal.scale_to_fit_width(0.7*neuron.get_width())
+ decimal.set_width(0.7*neuron.get_width())
decimal.move_to(neuron)
if activation > 0.8:
decimal.set_color(BLACK)
@@ -1390,7 +1390,7 @@ class WalkThroughTwoExample(ShowAveragingCost):
class WriteHebbian(Scene):
def construct(self):
words = TextMobject("Hebbian theory")
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
words.to_edge(UP)
self.play(Write(words))
self.wait()
@@ -1405,7 +1405,7 @@ class NotANeuroScientist(TeacherStudentsScene):
asterisks.set_color(BLUE)
brain = SVGMobject(file_name = "brain")
- brain.scale_to_fit_height(1.5)
+ brain.set_height(1.5)
self.add(brain)
double_arrow = DoubleArrow(LEFT, RIGHT)
double_arrow.next_to(brain, RIGHT)
@@ -1413,7 +1413,7 @@ class NotANeuroScientist(TeacherStudentsScene):
q_marks.next_to(double_arrow, UP)
network = NetworkMobject(Network(sizes = [6, 4, 4, 5]))
- network.scale_to_fit_height(1.5)
+ network.set_height(1.5)
network.next_to(double_arrow, RIGHT)
group = VGroup(brain, double_arrow, q_marks, network)
@@ -1776,7 +1776,7 @@ class ConstructGradientFromAllTrainingExamples(Scene):
def get_example(self, in_vect, index):
result = MNistMobject(in_vect)
- result.scale_to_fit_height(self.image_height)
+ result.set_height(self.image_height)
eyes = Eyes(result, height = self.eyes_height)
result.eyes = eyes
@@ -1992,14 +1992,14 @@ class OrganizeDataIntoMiniBatches(Scene):
MNistMobject(
t[0],
rect_kwargs = {"stroke_width" : 2}
- ).scale_to_fit_height(height)
+ ).set_height(height)
for t in training_data[:n_examples]
])
# return Group(*[
# Square(
# color = BLUE,
# stroke_width = 2
- # ).scale_to_fit_height(height)
+ # ).set_height(height)
# for x in range(n_examples)
# ])
@@ -3346,7 +3346,7 @@ class SimplestNetworkExample(PreviewLearning):
lb.next_to(terms, LEFT, buff = SMALL_BUFF)
rb.next_to(terms, RIGHT, buff = SMALL_BUFF)
vect = VGroup(lb, terms, rb)
- vect.scale_to_fit_height(5)
+ vect.set_height(5)
lhs = TexMobject("\\nabla C", "=")
lhs[0].set_color(RED)
lhs.next_to(vect, LEFT)
@@ -3614,7 +3614,7 @@ class SimplestNetworkExample(PreviewLearning):
def get_neuron_activation_decimal(self, neuron):
opacity = neuron.get_fill_opacity()
decimal = DecimalNumber(opacity, num_decimal_places = 2)
- decimal.scale_to_fit_width(0.85*neuron.get_width())
+ decimal.set_width(0.85*neuron.get_width())
if decimal.number > 0.8:
decimal.set_fill(BLACK)
decimal.move_to(neuron)
diff --git a/old_projects/nn/playground.py b/old_projects/nn/playground.py
index 19be7b913..f6b22e7b6 100644
--- a/old_projects/nn/playground.py
+++ b/old_projects/nn/playground.py
@@ -35,7 +35,7 @@ class Test(Scene):
# h_group.arrange_submobjects(LEFT)
# group.add(h_group)
# group.arrange_submobjects(DOWN)
- # group.scale_to_fit_height(FRAME_HEIGHT - 1)
+ # group.set_height(FRAME_HEIGHT - 1)
# self.add(group)
@@ -49,7 +49,7 @@ class Test(Scene):
]).arrange_submobjects(RIGHT)
for x in range(10)
]).arrange_submobjects(DOWN)
- group.scale_to_fit_height(FRAME_HEIGHT - 1)
+ group.set_height(FRAME_HEIGHT - 1)
self.add(group)
def show_weight_rows(self, network, index):
@@ -62,7 +62,7 @@ class Test(Scene):
pixel.set_fill(color, opacity = opacity)
group.add(mob)
group.arrange_submobjects_in_grid()
- group.scale_to_fit_height(FRAME_HEIGHT - 1)
+ group.set_height(FRAME_HEIGHT - 1)
self.add(group)
def show_all_activation_images(self, network, test_data):
@@ -73,7 +73,7 @@ class Test(Scene):
image_samples.arrange_submobjects_in_grid(
n_rows = 2, buff = LARGE_BUFF
)
- image_samples.scale_to_fit_height(FRAME_HEIGHT - 1)
+ image_samples.set_height(FRAME_HEIGHT - 1)
self.add(image_samples)
def get_activation_images(self, digit, network, test_data, n_examples = 8):
@@ -89,7 +89,7 @@ class Test(Scene):
]).arrange_submobjects(RIGHT)
for vect in input_vectors[:n_examples]
]).arrange_submobjects(DOWN)
- activation_iamges.scale_to_fit_height(FRAME_HEIGHT - 1)
+ activation_iamges.set_height(FRAME_HEIGHT - 1)
return activation_iamges
def show_two_blend(self):
@@ -116,7 +116,7 @@ class Test(Scene):
group.arrange_submobjects(DOWN+RIGHT, SMALL_BUFF)
groups.add(group)
groups.arrange_submobjects_in_grid()
- groups.scale_to_fit_height(FRAME_HEIGHT - 1)
+ groups.set_height(FRAME_HEIGHT - 1)
self.add(groups)
def show_test_input(self, network):
@@ -127,7 +127,7 @@ class Test(Scene):
if test[1] in [4, 9]
])
group.arrange_submobjects(DOWN, buff = MED_LARGE_BUFF)
- group.scale_to_fit_height(FRAME_HEIGHT - 1)
+ group.set_height(FRAME_HEIGHT - 1)
self.play(FadeIn(group))
def get_set(self, network, test):
diff --git a/old_projects/patreon.py b/old_projects/patreon.py
index d4bfbd061..30a18bd1c 100644
--- a/old_projects/patreon.py
+++ b/old_projects/patreon.py
@@ -21,7 +21,7 @@ class SideGigToFullTime(Scene):
Line(vect, -vect, color = RED)
for vect in (UP+RIGHT, UP+LEFT)
])
- cross.scale_to_fit_height(dollar_sign.get_height())
+ cross.set_height(dollar_sign.get_height())
no_money = VGroup(dollar_sign, cross)
no_money.next_to(rect, DOWN)
@@ -177,7 +177,7 @@ class TwoTypesOfVideos(Scene):
series.shift(FRAME_X_RADIUS*RIGHT/2)
series.to_edge(UP)
box = Rectangle(width = 16, height = 9, color = WHITE)
- box.scale_to_fit_height(3)
+ box.set_height(3)
box.next_to(stand_alone, DOWN)
series_list = VGroup(*[
TextMobject("Essence of %s"%s)
@@ -191,7 +191,7 @@ class TwoTypesOfVideos(Scene):
]
])
series_list.arrange_submobjects(DOWN, aligned_edge = LEFT, buff = MED_SMALL_BUFF)
- series_list.scale_to_fit_width(FRAME_X_RADIUS-2)
+ series_list.set_width(FRAME_X_RADIUS-2)
series_list.next_to(series, DOWN, buff = MED_SMALL_BUFF)
series_list.to_edge(RIGHT)
@@ -497,7 +497,7 @@ class PythagoreanTransformation(Scene):
class KindWordsOnEoLA(TeacherStudentsScene):
def construct(self):
rect = Rectangle(width = 16, height = 9, color = WHITE)
- rect.scale_to_fit_height(4)
+ rect.set_height(4)
title = TextMobject("Essence of linear algebra")
title.to_edge(UP)
rect.next_to(title, DOWN)
@@ -537,7 +537,7 @@ class MakeALotOfPiCreaturesHappy(Scene):
for pi, color in zip(pi_list, colors):
pi.set_color(color)
pis = VGroup(*pi_list)
- pis.scale_to_fit_height(6)
+ pis.set_height(6)
self.add(pis)
pis.generate_target()
diff --git a/old_projects/pi_day.py b/old_projects/pi_day.py
index c5c3a3bdc..8445d7c1e 100644
--- a/old_projects/pi_day.py
+++ b/old_projects/pi_day.py
@@ -353,7 +353,7 @@ class HartlAndPalais(Scene):
color = WHITE,
stroke_width = 1,
)
- hartl_rect.scale_to_fit_width(FRAME_X_RADIUS - 1)
+ hartl_rect.set_width(FRAME_X_RADIUS - 1)
hartl_rect.to_edge(LEFT)
palais_rect = hartl_rect.copy()
palais_rect.to_edge(RIGHT)
@@ -473,7 +473,7 @@ class EulerWrites628(Scene):
}
def construct(self):
image = ImageMobject(os.path.join(RESOURCE_DIR, "dalembert_zoom"))
- image.scale_to_fit_width(FRAME_WIDTH - 1)
+ image.set_width(FRAME_WIDTH - 1)
image.to_edge(UP, buff = MED_SMALL_BUFF)
image.fade(0.15)
rect = Rectangle(
@@ -557,7 +557,7 @@ class HeroAndVillain(Scene):
bad_euler = get_image("Leonard_Euler_revealed")
pictures = good_euler, bad_euler_pixelated, bad_euler
for mob in pictures:
- mob.scale_to_fit_height(5)
+ mob.set_height(5)
good_euler.move_to(FRAME_X_RADIUS*LEFT/2)
bad_euler.move_to(FRAME_X_RADIUS*RIGHT/2)
@@ -594,7 +594,7 @@ class HeroAndVillain(Scene):
class AnalysisQuote(Scene):
def construct(self):
analysis = get_image("Analysis_page_showing_pi")
- analysis.scale_to_fit_height(FRAME_HEIGHT)
+ analysis.set_height(FRAME_HEIGHT)
analysis.to_edge(LEFT, buff = 0)
text = TextMobject(
@@ -610,7 +610,7 @@ class AnalysisQuote(Scene):
pi_formula = TexMobject(
"\\pi", "=", "{ \\text{semicircumference}", "\\over", "\\text{radius}}"
)
- text.scale_to_fit_width(FRAME_X_RADIUS)
+ text.set_width(FRAME_X_RADIUS)
text.next_to(analysis, RIGHT, LARGE_BUFF)
text.to_edge(UP)
@@ -735,7 +735,7 @@ class ThingsNamedAfterEuler(Scene):
"Euler totient function (number theory)",
]))
group.arrange_submobjects(DOWN, aligned_edge = LEFT)
- group.scale_to_fit_height(FRAME_HEIGHT - 1)
+ group.set_height(FRAME_HEIGHT - 1)
self.play(LaggedStart(FadeIn, group, lag_ratio = 0.2, run_time = 12))
self.wait()
@@ -743,7 +743,7 @@ class ThingsNamedAfterEuler(Scene):
class EulerThinking(Scene):
def construct(self):
image = get_image("Leonhard_Euler_by_Handmann")
- image.scale_to_fit_height(4)
+ image.set_height(4)
image.to_edge(DOWN)
image.shift(4*LEFT)
bubble = ThoughtBubble(height = 4.5)
@@ -1049,7 +1049,7 @@ class EndScene(PatreonEndScreen):
]
])
for i, picture in enumerate(pictures):
- picture.scale_to_fit_height(2)
+ picture.set_height(2)
picture.next_to(instagram, DOWN, aligned_edge = RIGHT)
if i%3 != 0:
picture.next_to(last_picture, LEFT, buff = 0)
@@ -1064,7 +1064,7 @@ class Thumbnail(Scene):
formula.scale(2)
pi.scale(1.5, about_edge = RIGHT)
formula.set_stroke(BLUE, 1)
- formula.scale_to_fit_width(FRAME_WIDTH - 2)
+ formula.set_width(FRAME_WIDTH - 2)
# formula.shift(0.5*RIGHT)
self.add(formula)
diff --git a/old_projects/putnam.py b/old_projects/putnam.py
index df0e5a2c8..eb8eae3a8 100644
--- a/old_projects/putnam.py
+++ b/old_projects/putnam.py
@@ -155,7 +155,7 @@ class NatureOf5sAnd6s(TeacherStudentsScene):
)
new_words = TextMobject("\\dots Potentially very elegant \\dots")
new_words.set_color(GREEN)
- new_words.scale_to_fit_height(mover.target[1].get_height())
+ new_words.set_height(mover.target[1].get_height())
new_words.next_to(mover.target[0], RIGHT, SMALL_BUFF)
self.play(
@@ -177,7 +177,7 @@ class NatureOf5sAnd6s(TeacherStudentsScene):
class OtherVideoClips(Scene):
def construct(self):
rect = ScreenRectangle()
- rect.scale_to_fit_height(6.5)
+ rect.set_height(6.5)
rect.center()
rect.to_edge(DOWN)
titles = map(TextMobject, [
@@ -207,7 +207,7 @@ class IntroduceTetrahedronSupplement(Scene):
question = TextMobject("Probability that this tetrahedron \\\\ contains the sphere's center?")
question.next_to(title, DOWN, MED_LARGE_BUFF)
group = VGroup(title, question)
- group.scale_to_fit_width(FRAME_WIDTH-1)
+ group.set_width(FRAME_WIDTH-1)
group.to_edge(DOWN)
for n in range(1, 4):
@@ -371,11 +371,11 @@ class TwoDCase(Scene):
push_pins = VGroup()
for point_mob in self.point_mobs[:-1]:
push_pin = SVGMobject(file_name = "push_pin")
- push_pin.scale_to_fit_height(0.5)
+ push_pin.set_height(0.5)
push_pin.move_to(point_mob.get_center(), DOWN)
line = Line(ORIGIN, UP)
line.set_stroke(WHITE, 2)
- line.scale_to_fit_height(0.1)
+ line.set_height(0.1)
line.move_to(push_pin, UP)
line.shift(0.3*SMALL_BUFF*(2*DOWN+LEFT))
push_pin.add(line)
@@ -794,7 +794,7 @@ class AverageSizeOfSphericalTriangleSectionSupplement(Scene):
arg_separator = ""
)
words.set_color_by_tex("section", GREEN)
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
words.to_edge(DOWN)
self.play(Write(words))
self.wait(3)
@@ -1257,7 +1257,7 @@ class ThreeDAnswer(Scene):
"Probability that the tetrahedron contains center:",
"$\\frac{1}{8}$"
)
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
words.to_edge(DOWN)
words[1].set_color(BLUE)
@@ -1297,7 +1297,7 @@ class ProblemSolvingTakeaways(Scene):
def construct(self):
title = TextMobject("Problem solving takeaways")
underline = Line(LEFT, RIGHT)
- underline.scale_to_fit_width(title.get_width()*1.1)
+ underline.set_width(title.get_width()*1.1)
underline.next_to(title, DOWN)
group = VGroup(title, underline)
group.to_corner(UP+LEFT)
@@ -1397,7 +1397,7 @@ class BrilliantPuzzle(PiCreatureScene):
rect.set_stroke(WHITE)
lines.set_stroke(WHITE, 2)
test = VGroup(rect, lines)
- test.scale_to_fit_height(0.5)
+ test.set_height(0.5)
return test
def create_pi_creatures(self):
@@ -1444,7 +1444,7 @@ class BrilliantPuzzle(PiCreatureScene):
circled_students.remove(to_remove)
for student in circled_students:
circle = Circle(color = YELLOW)
- circle.scale_to_fit_height(1.2*student.get_height())
+ circle.set_height(1.2*student.get_height())
circle.move_to(student)
circles.add(circle)
self.play(ShowCreation(circle))
@@ -1465,7 +1465,7 @@ class Promotion(PiCreatureScene):
url.to_corner(UP+LEFT)
rect = Rectangle(height = 9, width = 16)
- rect.scale_to_fit_height(5.5)
+ rect.set_height(5.5)
rect.next_to(url, DOWN)
rect.to_edge(LEFT)
@@ -1499,7 +1499,7 @@ class AddedPromoWords(Scene):
"First", "$2^8$", "vistors get",
"$(e^\\pi - \\pi)\\%$", "off"
)
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
words.to_edge(DOWN)
words.set_color_by_tex("2^8", YELLOW)
words.set_color_by_tex("pi", PINK)
diff --git a/old_projects/qa_round_two.py b/old_projects/qa_round_two.py
index ee374c9b7..e43f56578 100644
--- a/old_projects/qa_round_two.py
+++ b/old_projects/qa_round_two.py
@@ -16,7 +16,7 @@ class Announcements(PiCreatureScene):
title.to_edge(UP)
title.shift(LEFT)
underline = Line(LEFT, RIGHT)
- underline.scale_to_fit_width(1.2*title.get_width())
+ underline.set_width(1.2*title.get_width())
underline.next_to(title, DOWN)
announcements = VGroup(*[
@@ -65,7 +65,7 @@ class PowersOfTwo(Scene):
group = VGroup(mob, rect)
two_to_ten = group.copy()
group.generate_target()
- group.target.scale_to_fit_height(0.2)
+ group.target.set_height(0.2)
group.target[1].set_fill(BLUE, 1)
self.play(ShowCreation(rect))
@@ -79,7 +79,7 @@ class PowersOfTwo(Scene):
vect, buff = SMALL_BUFF
)
if group.get_height() > max_height:
- group.scale_to_fit_height(max_height)
+ group.set_height(max_height)
group.move_to(center)
pa = np.pi/3
self.play(
@@ -130,7 +130,7 @@ class PiHoldingScreen(PiCreatureScene):
def construct(self):
morty = self.pi_creature
screen = ScreenRectangle()
- screen.scale_to_fit_height(5.5)
+ screen.set_height(5.5)
screen.to_edge(UP, buff = LARGE_BUFF)
screen.to_edge(LEFT)
@@ -159,7 +159,7 @@ class PiHoldingScreen(PiCreatureScene):
class QuestionsLink(Scene):
def construct(self):
link = TextMobject("https://3b1b.co/questions")
- link.scale_to_fit_width(FRAME_WIDTH)
+ link.set_width(FRAME_WIDTH)
link.to_edge(DOWN)
self.play(Write(link))
self.wait()
@@ -167,12 +167,12 @@ class QuestionsLink(Scene):
class Thumbnail(Scene):
def construct(self):
equation = TexMobject("2^{19} = " + "{:,}".format(2**19))
- equation.scale_to_fit_width(FRAME_X_RADIUS)
+ equation.set_width(FRAME_X_RADIUS)
equation.to_edge(DOWN, buff = LARGE_BUFF)
q_and_a = TextMobject("Q\\&A \\\\ Round 2")
q_and_a.set_color_by_gradient(BLUE, YELLOW)
- q_and_a.scale_to_fit_width(FRAME_X_RADIUS)
+ q_and_a.set_width(FRAME_X_RADIUS)
q_and_a.to_edge(UP, buff = LARGE_BUFF)
eater = ImageMobject("eater", height = 3)
diff --git a/old_projects/tattoo.py b/old_projects/tattoo.py
index 751e6f70d..af883894a 100644
--- a/old_projects/tattoo.py
+++ b/old_projects/tattoo.py
@@ -52,7 +52,7 @@ class TrigRepresentationsScene(Scene):
theta = TexMobject("\\theta")
theta.shift(1.5*arc.point_from_proportion(0.5))
theta.set_color(self.theta_color)
- theta.scale_to_fit_height(self.theta_height)
+ theta.set_height(self.theta_height)
line = Line(ORIGIN, self.get_circle_point())
dot = Dot(line.get_end(), radius = 0.05)
return VGroup(line, arc, theta, dot)
@@ -512,7 +512,7 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene):
frac2.next_to(frac1)
frac2[-2].set_color(YELLOW)
frac_group = VGroup(opp_over_hyp, frac1, frac2)
- frac_group.scale_to_fit_width(FRAME_X_RADIUS-1)
+ frac_group.set_width(FRAME_X_RADIUS-1)
frac_group.next_to(ORIGIN, RIGHT).to_edge(UP)
question = TextMobject("Why is this $\\theta$?")
@@ -823,7 +823,7 @@ class Credit(Scene):
url.to_corner(UP+RIGHT, buff = LARGE_BUFF)
book = ImageMobject("zen_and_motorcycles")
- book.scale_to_fit_height(5)
+ book.set_height(5)
book.to_edge(DOWN, buff = LARGE_BUFF)
border = Rectangle(color = WHITE)
border.replace(book, stretch = True)
diff --git a/old_projects/triangle_of_power/end.py b/old_projects/triangle_of_power/end.py
index 7a10b6b48..b6defafce 100644
--- a/old_projects/triangle_of_power/end.py
+++ b/old_projects/triangle_of_power/end.py
@@ -217,7 +217,7 @@ class InYourOwnNotes(Scene):
g.submobjects = []
#end hack
top = TOP(2, None, "n", radius = 0.75)
- top.scale_to_fit_width(log_n.get_width())
+ top.set_width(log_n.get_width())
top.shift(log_n.get_center())
new_O_log_n = O_log_n.copy()
new_O_log_n.submobjects[1] = top
diff --git a/old_projects/triangle_of_power/triangle.py b/old_projects/triangle_of_power/triangle.py
index f7f4c1fcb..5fd7b2d7a 100644
--- a/old_projects/triangle_of_power/triangle.py
+++ b/old_projects/triangle_of_power/triangle.py
@@ -118,7 +118,7 @@ class TOP(VMobject):
return value
def put_top_on_vertix(self, index, top):
- top.scale_to_fit_height(2*self.get_value_height())
+ top.set_height(2*self.get_value_height())
vertices = np.array(top.get_vertices())
vertices[index] = 0
start = reduce(op.add, vertices)/2
@@ -147,7 +147,7 @@ class TOP(VMobject):
)
def rescale_corner_mobject(self, mobject):
- mobject.scale_to_fit_height(self.get_value_height())
+ mobject.set_height(self.get_value_height())
return self
def get_value_height(self):
@@ -280,7 +280,7 @@ class SixDifferentInverses(Scene):
top_rules = get_top_inverse_rules()
for rule, top_rule in zip(rules, top_rules):
- top_rule.scale_to_fit_height(1.5)
+ top_rule.set_height(1.5)
top_rule.center()
top_rule.shift(rule.get_center())
self.play(*map(FadeOut, rules))
@@ -760,7 +760,7 @@ class TowerExponentFrame(Scene):
$7{,}625{,}597{,}484{,}987$. But with the triangle
of power, the difference is crystal clear:
""")
- words.scale_to_fit_width(FRAME_WIDTH-1)
+ words.set_width(FRAME_WIDTH-1)
words.to_edge(UP)
top1 = TOP(TOP(3, 3), 3)
top2 = TOP(3, (TOP(3, 3)))
diff --git a/old_projects/triples.py b/old_projects/triples.py
index 798d3c2dd..1734e7f71 100644
--- a/old_projects/triples.py
+++ b/old_projects/triples.py
@@ -42,7 +42,7 @@ class IntroduceTriples(TeacherStudentsScene):
hyp_line = Line(ORIGIN, a*RIGHT+b*UP)
elbow = VMobject()
elbow.set_points_as_corners([LEFT, LEFT+UP, UP])
- elbow.scale_to_fit_width(0.2*triangle.get_width())
+ elbow.set_width(0.2*triangle.get_width())
elbow.move_to(triangle, DOWN+RIGHT)
triangle.add(elbow)
@@ -87,7 +87,7 @@ class IntroduceTriples(TeacherStudentsScene):
VGroup(*[c_square[i] for i in not_i_list]),
]
full_group = VGroup(triangle, square_groups)
- full_group.scale_to_fit_height(4)
+ full_group.set_height(4)
full_group.center()
full_group.to_edge(UP)
@@ -181,7 +181,7 @@ class CompareToFermatsLastTheorem(TeacherStudentsScene):
class WritePythagoreanTriple(Scene):
def construct(self):
words = TextMobject("``Pythagorean triple''")
- words.scale_to_fit_width(FRAME_WIDTH - LARGE_BUFF)
+ words.set_width(FRAME_WIDTH - LARGE_BUFF)
words.to_corner(DOWN+LEFT)
self.play(Write(words))
self.wait(2)
@@ -200,9 +200,9 @@ class ShowManyTriples(Scene):
triangle = Polygon(ORIGIN, a*RIGHT, a*RIGHT+b*UP)
triangle.set_color(WHITE)
max_width = max_height = 4
- triangle.scale_to_fit_height(max_height)
+ triangle.set_height(max_height)
if triangle.get_width() > max_width:
- triangle.scale_to_fit_width(max_width)
+ triangle.set_width(max_width)
triangle.move_to(2*RIGHT)
num_strings = map(str, (a, b, c))
labels = map(TexMobject, num_strings)
@@ -299,7 +299,7 @@ class BabylonianTablets(Scene):
triple = TexMobject(tex)
triples.add(triple)
triples.arrange_submobjects(DOWN, aligned_edge = LEFT)
- triples.scale_to_fit_height(FRAME_HEIGHT - LARGE_BUFF)
+ triples.set_height(FRAME_HEIGHT - LARGE_BUFF)
triples.to_edge(RIGHT)
self.add(title)
@@ -339,7 +339,7 @@ class PythagoreanProof(Scene):
fill_color = WHITE,
fill_opacity = 0.5
)
- triangle.scale_to_fit_height(3)
+ triangle.set_height(3)
triangle.center()
side_labels = self.get_triangle_side_labels(triangle)
triangle_copy = triangle.copy()
@@ -453,15 +453,15 @@ class PythagoreanProof(Scene):
)
for color in SIDE_COLORS
]
- a_square.scale_to_fit_width(triangle.get_width())
+ a_square.set_width(triangle.get_width())
a_square.move_to(triangle.get_bottom(), UP)
- b_square.scale_to_fit_height(triangle.get_height())
+ b_square.set_height(triangle.get_height())
b_square.move_to(triangle.get_right(), LEFT)
hyp_line = Line(
triangle.get_corner(UP+RIGHT),
triangle.get_corner(DOWN+LEFT),
)
- c_square.scale_to_fit_width(hyp_line.get_length())
+ c_square.set_width(hyp_line.get_length())
c_square.move_to(hyp_line.get_center(), UP)
c_square.rotate(
hyp_line.get_angle(),
@@ -2442,7 +2442,7 @@ class ProjectPointsOntoUnitCircle(DrawRadialLines):
unit_length/distance,
about_point = self.plane_center
)
- dot.target.scale_to_fit_width(0.01)
+ dot.target.set_width(0.01)
self.play(LaggedStart(
MoveToTarget, dots,
diff --git a/old_projects/uncertainty.py b/old_projects/uncertainty.py
index 4b049a764..134634b10 100644
--- a/old_projects/uncertainty.py
+++ b/old_projects/uncertainty.py
@@ -167,7 +167,7 @@ class RadarPulseSingleton(ContinualAnimation):
start_angle = -30*DEGREES,
angle = 60*DEGREES,
)
- self.arc.scale_to_fit_height(0.75*radar_dish.get_height())
+ self.arc.set_height(0.75*radar_dish.get_height())
self.arc.move_to(radar_dish, UP+RIGHT)
self.start_points = np.array(self.arc.points)
self.start_center = self.arc.get_center()
@@ -1405,7 +1405,7 @@ class CenterOfMassDescription(FourierRecapScene):
circle_plane = self.get_circle_plane()
circle_plane.save_state()
circle_plane.generate_target()
- circle_plane.target.scale_to_fit_height(FRAME_HEIGHT)
+ circle_plane.target.set_height(FRAME_HEIGHT)
circle_plane.target.center()
circle_plane.target.axes.set_stroke(width = 2)
circle_plane.target.main_lines.set_stroke(width = 2)
@@ -1791,7 +1791,7 @@ class IntroduceDopplerRadar(Scene):
color = WHITE
)
distance_text = TextMobject("$2 \\times$ distance/(signal speed)")
- distance_text.scale_to_fit_width(0.9*double_arrow.get_width())
+ distance_text.set_width(0.9*double_arrow.get_width())
distance_text.next_to(double_arrow, UP, SMALL_BUFF)
#v_line anim?
@@ -2892,7 +2892,7 @@ class IntroduceDeBroglie(Scene):
#Overlay real tower in video editor
eiffel_tower = Line(3*DOWN, 3*UP, stroke_width = 0)
picture = ImageMobject("de_Broglie")
- picture.scale_to_fit_height(4)
+ picture.set_height(4)
picture.to_corner(UP+LEFT)
name = TextMobject("Louis de Broglie")
name.next_to(picture, DOWN)
@@ -3545,7 +3545,7 @@ class HangingWeightsScene(MovingCameraScene):
self.play(*map(GrowArrow, arrows))
self.play(*[
UpdateFromAlphaFunc(
- weight, lambda w, a : w.scale_to_fit_width(
+ weight, lambda w, a : w.set_width(
2*interpolate(w.start_radius, w.target_radius, a)
),
run_time = 2
@@ -3568,7 +3568,7 @@ class HangingWeightsScene(MovingCameraScene):
def metaphor_for_something(self):
de_broglie = ImageMobject("de_Broglie")
- de_broglie.scale_to_fit_height(3.5)
+ de_broglie.set_height(3.5)
de_broglie.to_corner(DOWN+RIGHT)
words = TextMobject("""
If a photon's energy is carried as a wave \\\\
@@ -3624,7 +3624,7 @@ class HangingWeightsScene(MovingCameraScene):
original_center = camera_frame.get_center()
self.play(
UpdateFromAlphaFunc(
- camera_frame, lambda c, a : c.scale_to_fit_height(
+ camera_frame, lambda c, a : c.set_height(
interpolate(original_height, 0.95*rect.get_height(), a)
).move_to(
interpolate(original_center, rect.get_center(), a)
@@ -3637,7 +3637,7 @@ class HangingWeightsScene(MovingCameraScene):
run_time = 6
))
self.play(
- camera_frame.scale_to_fit_height, original_height,
+ camera_frame.set_height, original_height,
camera_frame.move_to, original_center,
ApplyMethod(self.k_tracker.shift, LEFT)
)
@@ -3662,7 +3662,7 @@ class HangingWeightsScene(MovingCameraScene):
randy = Randolph(mode = "pondering")
randy.look(UP+RIGHT)
de_broglie = ImageMobject("de_Broglie")
- de_broglie.scale_to_fit_height(6)
+ de_broglie.set_height(6)
de_broglie.next_to(4*DOWN, DOWN)
self.add(
ContinualUpdateFromFunc(
@@ -3725,7 +3725,7 @@ class MinutPhysicsWrapper(Scene):
title.to_edge(UP).shift(MED_LARGE_BUFF*RIGHT)
screen_rect = ScreenRectangle()
- screen_rect.scale_to_fit_width(title.get_width() + LARGE_BUFF)
+ screen_rect.set_width(title.get_width() + LARGE_BUFF)
screen_rect.next_to(title, DOWN)
self.play(ShowCreation(screen_rect))
@@ -4102,7 +4102,7 @@ class ProbabalisticDetection(FourierTransformOfWaveFunction):
rect.stretch(0, 0)
gdw_anim = ContinualUpdateFromFunc(
- gdw, lambda m : m.scale_to_fit_width(
+ gdw, lambda m : m.set_width(
2.0/(self.a_tracker.get_value()**(0.5))
).move_to(rect)
)
@@ -4230,8 +4230,8 @@ class OneLevelDeeper(Scene):
)
gdw = randomness.gaussian_distribution_wrapper
gdw.rotate(TAU/4)
- gdw.scale_to_fit_height(1)
- # gdw.scale_to_fit_width(4)
+ gdw.set_height(1)
+ # gdw.set_width(4)
gdw.next_to(hup_words, UP, MED_LARGE_BUFF)
self.add(hup_words, randomness)
@@ -4322,7 +4322,7 @@ class ThinkOfHeisenbergUncertainty(PiCreatureScene):
dot_cloud = ProbabalisticDotCloud()
dot_gdw = dot_cloud.gaussian_distribution_wrapper
- dot_gdw.scale_to_fit_width(1)
+ dot_gdw.set_width(1)
dot_gdw.rotate(TAU/8)
dot_gdw.move_to(FRAME_X_RADIUS*RIGHT/2),
@@ -4330,7 +4330,7 @@ class ThinkOfHeisenbergUncertainty(PiCreatureScene):
center_func = dot_gdw.get_center
)
vector_gdw = vector_cloud.gaussian_distribution_wrapper
- vector_gdw.scale_to_fit_width(0.1)
+ vector_gdw.set_width(0.1)
vector_gdw.rotate(TAU/8)
vector_gdw.next_to(dot_gdw, UP+LEFT, LARGE_BUFF)
@@ -4341,13 +4341,13 @@ class ThinkOfHeisenbergUncertainty(PiCreatureScene):
ContinualMovement(time_tracker, direction = RIGHT, rate = 1),
ContinualUpdateFromFunc(
dot_gdw,
- lambda d : d.scale_to_fit_width(
+ lambda d : d.set_width(
(np.cos(freq*time_tracker.get_value()) + 1.1)/2
)
),
ContinualUpdateFromFunc(
vector_gdw,
- lambda d : d.scale_to_fit_width(
+ lambda d : d.set_width(
(-np.cos(freq*time_tracker.get_value()) + 1.1)/2
)
),
@@ -4448,7 +4448,7 @@ class Promotion(PiCreatureScene):
url_rect.stretch_in_place(1.1, dim = 1)
rect = Rectangle(height = 9, width = 16)
- rect.scale_to_fit_height(4.5)
+ rect.set_height(4.5)
rect.next_to(url, DOWN)
rect.to_edge(LEFT)
rect.set_stroke(width = 0)
@@ -4458,7 +4458,7 @@ class Promotion(PiCreatureScene):
morty = self.pi_creature
morty.save_state()
book = ImageMobject("AoPS_volume_2")
- book.scale_to_fit_height(2)
+ book.set_height(2)
book.next_to(mathy, UP+LEFT).shift(MED_LARGE_BUFF*LEFT)
mathy.get_center = mathy.get_top
@@ -4586,7 +4586,7 @@ class PuzzleStatement(Scene):
to determine who we send. Can we make sure we don't send
the weakest person?
""", alignment = "")
- words.scale_to_fit_width(FRAME_WIDTH - 2)
+ words.set_width(FRAME_WIDTH - 2)
words.next_to(group, DOWN, LARGE_BUFF)
self.play(LaggedStart(FadeIn, words, run_time = 5, lag_ratio = 0.2))
self.wait(2)
diff --git a/old_projects/wallis.py b/old_projects/wallis.py
index 15c59a5d5..8fe789218 100644
--- a/old_projects/wallis.py
+++ b/old_projects/wallis.py
@@ -254,7 +254,7 @@ class SourcesOfOriginality(TeacherStudentsScene):
"Previous video based on\\\\",
"a paper by Johan W\\\"{a}stlund"
)
- based_on_wastlund.scale_to_fit_width(
+ based_on_wastlund.set_width(
left_rect.get_width() - MED_SMALL_BUFF)
based_on_wastlund.next_to(formula, DOWN, MED_LARGE_BUFF)
@@ -356,7 +356,7 @@ class SourcesOfOriginality(TeacherStudentsScene):
)
wallis_product = get_wallis_product(n_terms=4)
- wallis_product.scale_to_fit_width(
+ wallis_product.set_width(
left_rect.get_width() - 2 * MED_LARGE_BUFF)
wallis_product.move_to(self.math_content, UP)
wallis_product_name = TextMobject("``Wallis product''")
@@ -392,7 +392,7 @@ class Six(Scene):
six = TexMobject("6")
six.add_background_rectangle(opacity = 1)
six.background_rectangle.stretch(1.5, 0)
- six.scale_to_fit_height(7)
+ six.set_height(7)
self.add(six)
@@ -780,7 +780,7 @@ class ShowProduct(Scene):
class TeacherShowing(TeacherStudentsScene):
def construct(self):
screen = self.screen
- screen.scale_to_fit_height(4)
+ screen.set_height(4)
screen.next_to(self.students, UP, MED_LARGE_BUFF, RIGHT)
self.play(
ShowCreation(screen),
@@ -857,7 +857,7 @@ class DistanceProductScene(MovingCameraScene):
self.lighthouses = VGroup()
for point in self.get_lh_points():
lighthouse = Lighthouse()
- lighthouse.scale_to_fit_height(self.lighthouse_height)
+ lighthouse.set_height(self.lighthouse_height)
lighthouse.move_to(point)
self.lighthouses.add(lighthouse)
return self.lighthouses
@@ -889,7 +889,7 @@ class DistanceProductScene(MovingCameraScene):
self.d_labels = VGroup()
for i, line in enumerate(self.distance_lines):
d_label = TexMobject("d_%d" % i)
- d_label.scale_to_fit_height(self.d_label_height)
+ d_label.set_height(self.d_label_height)
vect = rotate_vector(line.get_vector(), 90 * DEGREES)
vect *= 2.5 * SMALL_BUFF / np.linalg.norm(vect)
d_label.move_to(line.get_center() + vect)
@@ -910,10 +910,10 @@ class DistanceProductScene(MovingCameraScene):
show_ellipsis=show_ellipsis,
include_background_rectangle=self.include_distance_labels_background_rectangle,
)
- label.scale_to_fit_height(self.numeric_distance_label_height)
+ label.set_height(self.numeric_distance_label_height)
max_width = 0.5 * max(line.get_length(), 0.1)
if label.get_width() > max_width:
- label.scale_to_fit_width(max_width)
+ label.set_width(max_width)
angle = (line.get_angle() % TAU) - TAU / 2
if np.abs(angle) > TAU / 4:
angle += np.sign(angle) * np.pi
@@ -933,12 +933,12 @@ class DistanceProductScene(MovingCameraScene):
stacked_labels = labels.copy()
for label in stacked_labels:
label.rotate(-label.angle)
- label.scale_to_fit_height(self.numeric_distance_label_height)
+ label.set_height(self.numeric_distance_label_height)
stacked_labels.arrange_submobjects(DOWN)
stacked_labels.move_to(column_top, UP)
h_line = Line(LEFT, RIGHT)
- h_line.scale_to_fit_width(1.5 * stacked_labels.get_width())
+ h_line.set_width(1.5 * stacked_labels.get_width())
h_line.next_to(stacked_labels, DOWN, aligned_edge=RIGHT)
times = TexMobject("\\times")
times.next_to(h_line, UP, SMALL_BUFF, aligned_edge=LEFT)
@@ -949,7 +949,7 @@ class DistanceProductScene(MovingCameraScene):
show_ellipsis=True,
include_background_rectangle=self.include_distance_labels_background_rectangle,
)
- product_decimal.scale_to_fit_height(self.numeric_distance_label_height)
+ product_decimal.set_height(self.numeric_distance_label_height)
product_decimal.next_to(h_line, DOWN)
product_decimal.align_to(stacked_labels, RIGHT)
product_decimal[1].set_color(BLUE)
@@ -1066,7 +1066,7 @@ class IntroduceDistanceProduct(DistanceProductScene):
for dot in lh_dots
])
evenly_space_dots_label = TextMobject("Evenly-spaced \\\\ dots")
- evenly_space_dots_label.scale_to_fit_width(0.5 * circle.get_width())
+ evenly_space_dots_label.set_width(0.5 * circle.get_width())
evenly_space_dots_label.move_to(circle)
special_dot = self.special_dot = self.get_observer_dot()
@@ -1103,7 +1103,7 @@ class IntroduceDistanceProduct(DistanceProductScene):
observer = self.get_observer()
observer.save_state()
- observer.scale_to_fit_height(2)
+ observer.set_height(2)
observer.change_mode("happy")
observer.to_edge(RIGHT)
@@ -1284,7 +1284,7 @@ class IntroduceDistanceProduct(DistanceProductScene):
lights = self.lights
circle.generate_target()
- circle.target.scale_to_fit_width(2 * self.circle_radius)
+ circle.target.set_width(2 * self.circle_radius)
circle.target.to_corner(DL)
self.circle = circle.target
@@ -1523,7 +1523,7 @@ class FromGeometryToAlgebra(DistanceProductScene):
def setup_lights(self):
circle = self.circle
- circle.scale_to_fit_height(5, about_edge=DOWN)
+ circle.set_height(5, about_edge=DOWN)
lights = self.get_lights()
dots = VGroup(*[Dot(point) for point in self.get_lh_points()])
for dot, light in zip(dots, lights):
@@ -1549,7 +1549,7 @@ class FromGeometryToAlgebra(DistanceProductScene):
)
spacing_words = self.spacing_words = TextMobject("Evenly-spaced")
- spacing_words.scale_to_fit_width(self.get_radius())
+ spacing_words.set_width(self.get_radius())
spacing_words.move_to(circle)
arrows = self.get_arrows()
@@ -1961,7 +1961,7 @@ class PlugObserverIntoPolynomial(DistanceProductScene):
def add_circle_group(self):
self.circle.set_color(RED)
- self.circle.scale_to_fit_width(
+ self.circle.set_width(
2 * np.linalg.norm(self.plane.number_to_point(1) - self.origin)
)
self.circle.move_to(self.origin)
@@ -2996,7 +2996,7 @@ class ArmedWithTwoKeyFacts(TeacherStudentsScene, DistanceProductScene):
def construct(self):
circle1 = self.circle
- circle1.scale_to_fit_height(1.5)
+ circle1.set_height(1.5)
circle1.to_corner(UL)
circle2 = circle1.copy()
circle2.next_to(circle1, DOWN, MED_LARGE_BUFF)
@@ -3061,7 +3061,7 @@ class Sailor(PiCreature):
)
rhombus.set_fill(BLACK, opacity=1)
rhombus.set_stroke(width=0)
- rhombus.scale_to_fit_height(sailor_hat.get_height() / 3)
+ rhombus.set_height(sailor_hat.get_height() / 3)
rhombus.rotate(5 * DEGREES)
rhombus.move_to(sailor_hat, DR)
rhombus.shift(0.05 * sailor_hat.get_width() * LEFT)
@@ -3166,7 +3166,7 @@ class KeeperAndSailor(DistanceProductScene, PiCreatureScene):
self.add_foreground_mobjects(keeper, keeper.dot, keeper.title)
for pi in observers:
self.play(
- pi.scale_to_fit_height, 0.5,
+ pi.set_height, 0.5,
pi.next_to, pi.target_point, RIGHT, SMALL_BUFF,
pi.dot.move_to, pi.target_point,
pi.dot.set_fill, {"opacity": 1},
@@ -3355,7 +3355,7 @@ class KeeperAndSailor(DistanceProductScene, PiCreatureScene):
"K": BLUE,
"S": YELLOW,
})
- product_parts.scale_to_fit_width(0.4 * FRAME_WIDTH)
+ product_parts.set_width(0.4 * FRAME_WIDTH)
product_parts.next_to(result_fraction, DOWN, LARGE_BUFF, RIGHT)
product_parts.shift(MED_SMALL_BUFF * RIGHT)
@@ -3857,7 +3857,7 @@ class KeeperAndSailor(DistanceProductScene, PiCreatureScene):
for title in titles:
if not hasattr(title, "original_height"):
title.original_height = title.get_height()
- title.scale_to_fit_height(min(
+ title.set_height(min(
title.original_height,
0.8 * get_ks_distance(),
))
@@ -3873,7 +3873,7 @@ class KeeperAndSailor(DistanceProductScene, PiCreatureScene):
if k == 0:
continue
light = lights[k]
- light = light.scale_to_fit_width(
+ light = light.set_width(
(get_fraction() / start_fraction) * initial_light_width
)
point = self.get_circle_point_at_proportion(k * get_fraction())
@@ -3959,7 +3959,7 @@ class KeeperAndSailor(DistanceProductScene, PiCreatureScene):
keeper = self.keeper = PiCreature(color=self.keeper_color).flip()
sailor = self.sailor = Sailor()
observers = self.observers = VGroup(keeper, sailor)
- observers.scale_to_fit_height(3)
+ observers.set_height(3)
keeper.shift(4 * RIGHT + 2 * DOWN)
sailor.shift(4 * RIGHT + 2 * UP)
return VGroup(keeper, sailor)
@@ -4054,13 +4054,13 @@ class MentionJohnWallis(Scene):
name.next_to(product, DOWN, MED_LARGE_BUFF)
image = ImageMobject("John_Wallis")
- image.scale_to_fit_height(3)
+ image.set_height(3)
image.next_to(name, DOWN)
image_name = TextMobject("John Wallis")
image_name.next_to(image, DOWN)
infinity = TexMobject("\\infty")
- infinity.scale_to_fit_height(1.5)
+ infinity.set_height(1.5)
infinity.next_to(image, RIGHT, MED_LARGE_BUFF)
self.add(product)
@@ -4256,7 +4256,7 @@ class HowThisArgumentRequiresCommunitingLimits(PiCreatureScene):
def create_pi_creatures(self):
group = VGroup(PiCreature(color=GREY), Mortimer())
- group.scale_to_fit_height(2)
+ group.set_height(2)
group.arrange_submobjects(RIGHT, buff=4)
group.to_edge(DOWN)
return group
@@ -4941,7 +4941,7 @@ class KeeperAndSailorForSineProduct(KeeperAndSailor):
Mortimer()
)
pi_creatures.arrange_submobjects(RIGHT, LARGE_BUFF)
- pi_creatures.scale_to_fit_height(1)
+ pi_creatures.set_height(1)
pi_creatures.next_to(rect, DOWN)
for pi in pi_creatures:
pi.change("hooray", rect)
@@ -4982,7 +4982,7 @@ class Conclusion(TeacherStudentsScene):
sine_formula.shift_onto_screen()
euler = ImageMobject("Euler")
- euler.scale_to_fit_height(2.5)
+ euler.set_height(2.5)
basel_problem = TexMobject(
"\\frac{1}{1^2} + ",
"\\frac{1}{2^2} + ",
@@ -5239,7 +5239,7 @@ class Thumbnail(DistanceProductScene):
bottom_dot = Dot(color=BLUE)
bottom_dot.move_to(circle.get_bottom())
observer = PiCreature(mode="pondering")
- observer.scale_to_fit_height(0.5)
+ observer.set_height(0.5)
observer.next_to(bottom_dot, DOWN)
lights = VGroup()
diff --git a/old_projects/waves.py b/old_projects/waves.py
index 06fb3a838..a278940c3 100644
--- a/old_projects/waves.py
+++ b/old_projects/waves.py
@@ -524,7 +524,7 @@ class VideoWrapper(Scene):
title.to_edge(UP)
self.add(title)
rect = ScreenRectangle()
- rect.scale_to_fit_height(6)
+ rect.set_height(6)
rect.next_to(title, DOWN)
self.add(rect)
self.wait()
@@ -946,7 +946,7 @@ class WriteCurlEquations(Scene):
)
eqs = VGroup(eq1, eq2)
eqs.arrange_submobjects(DOWN, buff = LARGE_BUFF)
- eqs.scale_to_fit_height(FRAME_HEIGHT - 1)
+ eqs.set_height(FRAME_HEIGHT - 1)
eqs.to_edge(LEFT)
for eq in eqs:
eq.set_color_by_tex_to_color_map({
@@ -1169,7 +1169,7 @@ class ShowVectorEquation(Scene):
)
components.arrange_submobjects(DOWN)
lb, rb = brackets = TexMobject("[]")
- brackets.scale_to_fit_height(components.get_height() + SMALL_BUFF)
+ brackets.set_height(components.get_height() + SMALL_BUFF)
lb.next_to(components, LEFT, buff = 0.3)
rb.next_to(components, RIGHT, buff = 0.3)
E, equals = E_equals = TexMobject(
@@ -1872,7 +1872,7 @@ class FromBracketFootnote(Scene):
arg_separator = ""
)
words.set_color_by_tex("ket", YELLOW)
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
self.add(words)
class Ay(Scene):
@@ -1991,7 +1991,7 @@ class AlternateBasis(ShowTipToTailSum):
class WriteBasis(Scene):
def construct(self):
words = TextMobject("Choice of ``basis''")
- words.scale_to_fit_width(FRAME_WIDTH-1)
+ words.set_width(FRAME_WIDTH-1)
self.play(Write(words))
self.wait()
@@ -2149,7 +2149,7 @@ class ShowPolarizingFilter(DirectionOfPolarizationScene):
new_decimal.rotate(np.pi/2, RIGHT)
new_decimal.rotate(np.pi/2, OUT)
new_decimal.rotate(self.camera.get_theta(), OUT)
- new_decimal.scale_to_fit_depth(decimal.get_depth())
+ new_decimal.set_depth(decimal.get_depth())
new_decimal.move_to(decimal, UP)
new_decimal.set_color(decimal.get_color())
decimal.align_data(new_decimal)
@@ -2176,7 +2176,7 @@ class ShowPolarizingFilter(DirectionOfPolarizationScene):
class NamePolarizingFilter(Scene):
def construct(self):
words = TextMobject("Polarizing filter")
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
self.play(Write(words))
self.wait()
@@ -2873,14 +2873,14 @@ class SeeCommentInDescription(Scene):
vs. double-headed arrows
\\end{flushleft}
""")
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
words.to_corner(DOWN+LEFT)
self.add(words)
class SeeCommentInDescriptionAgain(Scene):
def construct(self):
words = TextMobject("$^*$Again, see description")
- words.scale_to_fit_width(FRAME_WIDTH - 1)
+ words.set_width(FRAME_WIDTH - 1)
words.to_corner(DOWN+LEFT)
self.add(words)
@@ -4173,7 +4173,7 @@ class ClockwisePhotonInsert(Scene):
)
eq.set_color(BLUE)
VGroup(*it.chain(eq[:4], eq[-5:])).set_color(WHITE)
- eq.scale_to_fit_height(FRAME_HEIGHT - 1)
+ eq.set_height(FRAME_HEIGHT - 1)
eq.to_edge(LEFT)
self.add(eq)
@@ -4275,7 +4275,7 @@ class Footnote(Scene):
from quantum mechanics conventions.
\\end{flushleft}
""")
- words.scale_to_fit_width(FRAME_WIDTH - 2)
+ words.set_width(FRAME_WIDTH - 2)
self.add(words)
diff --git a/old_projects/wcat.py b/old_projects/wcat.py
index ed31584ca..7c3a44571 100644
--- a/old_projects/wcat.py
+++ b/old_projects/wcat.py
@@ -448,17 +448,17 @@ class DefineInscribedSquareProblem(ClosedLoopScene):
ellipse.stretch(1.5, 0)
ellipse.stretch(0.7, 1)
ellipse.rotate(-np.pi/2)
- ellipse.scale_to_fit_height(4)
+ ellipse.set_height(4)
pi_loop = TexMobject("\\pi")[0]
pi_loop.set_fill(opacity = 0)
pi_loop.set_stroke(
color = WHITE,
width = DEFAULT_POINT_THICKNESS
)
- pi_loop.scale_to_fit_height(4)
+ pi_loop.set_height(4)
randy = Randolph()
randy.look(DOWN)
- randy.scale_to_fit_width(pi_loop.get_width())
+ randy.set_width(pi_loop.get_width())
randy.move_to(pi_loop, aligned_edge = DOWN)
randy.body.set_fill(opacity = 0)
randy.mouth.set_stroke(width = 0)
@@ -1062,7 +1062,7 @@ class RepresentPairInUnitSquare(ClosedLoopScene):
line.make_smooth()
vert_interval = interval.copy()
square = Square()
- square.scale_to_fit_width(interval.get_width())
+ square.set_width(interval.get_width())
square.set_stroke(width = 0)
square.set_fill(color = BLUE, opacity = 0.3)
square.move_to(
@@ -1189,7 +1189,7 @@ class EdgesOfSquare(Scene):
vert_interval = interval.copy()
vert_interval.rotate(np.pi, axis = UP+RIGHT, about_point = bottom_left)
square = Square()
- square.scale_to_fit_width(interval.get_width())
+ square.set_width(interval.get_width())
square.set_stroke(width = 0)
square.set_fill(color = BLUE, opacity = 0.3)
square.move_to(
diff --git a/old_projects/zeta.py b/old_projects/zeta.py
index fde5b758e..9189cc8c3 100644
--- a/old_projects/zeta.py
+++ b/old_projects/zeta.py
@@ -692,16 +692,16 @@ class ReadIntoZetaFunction(Scene):
Line(LEFT, RIGHT).shift(0.2*DOWN),
Line(LEFT, ORIGIN).shift(0.4*DOWN)
)
- paragraph_lines.scale_to_fit_width(max_width)
+ paragraph_lines.set_width(max_width)
paragraph_lines.next_to(title, DOWN, MED_LARGE_BUFF)
paper.add(paragraph_lines)
max_height = 1.5*paragraph_lines.get_height()
statement = TextMobject(self.statement)
if statement.get_width() > max_width:
- statement.scale_to_fit_width(max_width)
+ statement.set_width(max_width)
if statement.get_height() > max_height:
- statement.scale_to_fit_height(max_height)
+ statement.set_height(max_height)
statement.next_to(paragraph_lines, DOWN)
statement.set_color(GREEN_B)
@@ -775,7 +775,7 @@ class RiemannFatherOfComplex(ComplexTransformationScene):
name.add_background_rectangle()
# photo = Square()
photo = ImageMobject("Riemann", invert = False)
- photo.scale_to_fit_width(5)
+ photo.set_width(5)
photo.next_to(name, DOWN, aligned_edge = LEFT)
@@ -1003,7 +1003,7 @@ class FromRealToComplex(ComplexTransformationScene):
def transition_to_spiril_sum(self):
zeta = self.get_zeta_definition("2+i", "1.15 - 0.44i")
- zeta.scale_to_fit_width(FRAME_WIDTH-1)
+ zeta.set_width(FRAME_WIDTH-1)
zeta.to_corner(UP+LEFT)
lines, output_dot = self.get_sum_lines(complex(2, 1))
@@ -1371,7 +1371,7 @@ class ComplexExponentiation(Scene):
exp = self.imag_exponent[-1]
new_exp = TexMobject("ti")
new_exp.set_color(exp.get_color())
- new_exp.scale_to_fit_height(exp.get_height())
+ new_exp.set_height(exp.get_height())
new_exp.move_to(exp, LEFT)
nine = TexMobject("9")
@@ -2845,7 +2845,7 @@ class DiscussZeros(ZetaTransformationScene):
primes.to_corner(UP+RIGHT)
# photo = Square()
photo = ImageMobject("Riemann", invert = False)
- photo.scale_to_fit_width(5)
+ photo.set_width(5)
photo.to_corner(UP+LEFT)
new_dots = VGroup(*[
Dot(0.5*RIGHT + y*UP)
@@ -3100,11 +3100,11 @@ class DiscussSumOfNaturals(Scene):
class InventingMathPreview(Scene):
def construct(self):
rect = Rectangle(height = 9, width = 16)
- rect.scale_to_fit_height(4)
+ rect.set_height(4)
title = TextMobject("What does it feel like to invent math?")
title.next_to(rect, UP)
sum_tex = TexMobject("1+2+4+8+\\cdots = -1")
- sum_tex.scale_to_fit_width(rect.get_width()-1)
+ sum_tex.set_width(rect.get_width()-1)
self.play(
ShowCreation(rect),
@@ -3162,7 +3162,7 @@ class PatreonThanks(Scene):
special_thanks.set_color(YELLOW)
special_thanks.shift(3*UP)
patreon_logo = ImageMobject("patreon", invert = False)
- patreon_logo.scale_to_fit_height(1.5)
+ patreon_logo.set_height(1.5)
patreon_logo.next_to(special_thanks, DOWN)
left_patrons = VGroup(*map(TextMobject,
@@ -3272,18 +3272,18 @@ class Thumbnail(ZetaTransformationScene):
self.plane.set_stroke(width = 4)
div_sum = TexMobject("-\\frac{1}{12} = ", "1+2+3+4+\\cdots")
- div_sum.scale_to_fit_width(FRAME_WIDTH-1)
+ div_sum.set_width(FRAME_WIDTH-1)
div_sum.to_edge(DOWN)
div_sum.set_color(YELLOW)
for mob in div_sum.submobjects:
mob.add_to_back(BackgroundRectangle(mob))
zeta = TexMobject("\\zeta(s)")
- zeta.scale_to_fit_height(FRAME_Y_RADIUS-1)
+ zeta.set_height(FRAME_Y_RADIUS-1)
zeta.to_corner(UP+LEFT)
million = TexMobject("\\$1{,}000{,}000")
- million.scale_to_fit_width(FRAME_X_RADIUS+1)
+ million.set_width(FRAME_X_RADIUS+1)
million.to_edge(UP+RIGHT)
million.set_color(GREEN_B)
million.add_background_rectangle()
diff --git a/once_useful_constructs/counting.py b/once_useful_constructs/counting.py
index 4bc5e539a..ac0080859 100644
--- a/once_useful_constructs/counting.py
+++ b/once_useful_constructs/counting.py
@@ -63,7 +63,7 @@ class CountingScene(Scene):
)
for point in self.get_template_configuration(place)
])
- dots.scale_to_fit_height(self.dot_configuration_height)
+ dots.set_height(self.dot_configuration_height)
return dots
def add_configuration(self):
diff --git a/once_useful_constructs/fractals.py b/once_useful_constructs/fractals.py
index 94579d836..711d6ac41 100644
--- a/once_useful_constructs/fractals.py
+++ b/once_useful_constructs/fractals.py
@@ -105,7 +105,7 @@ class SelfSimilarFractal(VMobject):
self.arrange_subparts(*subparts)
result = VGroup(*subparts)
- result.scale_to_fit_height(self.height)
+ result.set_height(self.height)
result.center()
return result
@@ -215,7 +215,7 @@ class PiCreatureFractal(VMobject):
random.seed(self.random_seed)
modes = get_all_pi_creature_modes()
seed = PiCreature(mode=self.start_mode)
- seed.scale_to_fit_height(self.height)
+ seed.set_height(self.height)
seed.to_edge(DOWN)
creatures = [seed]
self.add(VGroup(seed))
@@ -226,7 +226,7 @@ class PiCreatureFractal(VMobject):
new_creature = PiCreature(
mode=random.choice(modes)
)
- new_creature.scale_to_fit_height(
+ new_creature.set_height(
self.scale_val * eye.get_height()
)
new_creature.next_to(
@@ -259,7 +259,7 @@ class WonkyHexagonFractal(SelfSimilarFractal):
center_row = VGroup(p1, p4, p7)
center_row.arrange_submobjects(RIGHT, buff=0)
for p in p2, p3, p5, p6:
- p.scale_to_fit_width(p1.get_width())
+ p.set_width(p1.get_width())
p2.move_to(p1.get_top(), DOWN + LEFT)
p3.move_to(p1.get_bottom(), UP + LEFT)
p5.move_to(p4.get_top(), DOWN + LEFT)
diff --git a/once_useful_constructs/matrix_multiplication.py b/once_useful_constructs/matrix_multiplication.py
index 8bb1d1913..367f7bb8d 100644
--- a/once_useful_constructs/matrix_multiplication.py
+++ b/once_useful_constructs/matrix_multiplication.py
@@ -84,7 +84,7 @@ class NumericalMatrixMultiplication(Scene):
equals = TexMobject("=")
everything = VGroup(left, right, equals, result)
everything.arrange_submobjects()
- everything.scale_to_fit_width(FRAME_WIDTH - 1)
+ everything.set_width(FRAME_WIDTH - 1)
self.add(everything)
def animate_product(self, left, right, result):
diff --git a/scene/graph_scene.py b/scene/graph_scene.py
index f9839000d..76def06b6 100644
--- a/scene/graph_scene.py
+++ b/scene/graph_scene.py
@@ -412,9 +412,9 @@ class GraphScene(Scene):
max_width = 0.8 * group.dx_line.get_width()
max_height = 0.8 * group.df_line.get_height()
if labels.get_width() > max_width:
- labels.scale_to_fit_width(max_width)
+ labels.set_width(max_width)
if labels.get_height() > max_height:
- labels.scale_to_fit_height(max_height)
+ labels.set_height(max_height)
if dx_label is not None:
group.dx_label.next_to(
@@ -444,7 +444,7 @@ class GraphScene(Scene):
def add_T_label(self, x_val, side=RIGHT, label=None, color=WHITE, animated=False, **kwargs):
triangle = RegularPolygon(n=3, start_angle=np.pi / 2)
- triangle.scale_to_fit_height(MED_SMALL_BUFF)
+ triangle.set_height(MED_SMALL_BUFF)
triangle.move_to(self.coords_to_point(x_val, 0), UP)
triangle.set_fill(color, 1)
triangle.set_stroke(width=0)