mirror of
https://github.com/3b1b/manim.git
synced 2026-04-26 03:00:23 -04:00
Fix the width of riemann rectangles
This commit is contained in:
@@ -235,6 +235,7 @@ class CoordinateSystem():
|
||||
stroke_color=BLACK,
|
||||
fill_opacity=1,
|
||||
colors=(BLUE, GREEN),
|
||||
stroke_background=True,
|
||||
show_signed_area=True):
|
||||
if x_range is None:
|
||||
x_range = self.x_range[:2]
|
||||
@@ -257,7 +258,8 @@ class CoordinateSystem():
|
||||
height = get_norm(
|
||||
self.i2gp(sample, graph) - self.c2p(sample, 0)
|
||||
)
|
||||
rect = Rectangle(width=x1 - x0, height=height)
|
||||
rect = Rectangle(width=self.x_axis.n2p(x1)[0] - self.x_axis.n2p(x0)[0],
|
||||
height=height)
|
||||
rect.move_to(self.c2p(x0, 0), DL)
|
||||
rects.append(rect)
|
||||
result = VGroup(*rects)
|
||||
@@ -266,6 +268,7 @@ class CoordinateSystem():
|
||||
stroke_width=stroke_width,
|
||||
stroke_color=stroke_color,
|
||||
fill_opacity=fill_opacity,
|
||||
stroke_background=stroke_background
|
||||
)
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user