mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Fix the width of riemann rectangles
This commit is contained in:
parent
dfbbb34035
commit
67f8007764
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue