ManimCommunity / ManimCommunity/manim
Error in Cosine Function Graph
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
I am trying to create a cosine graph using Manim but it was different from the actual graph.
How should I edit my code to make it the actual graph. Thanks in advance.
Code:
from manim import *
from numpy import cos
class CreateGraph(GraphScene):
def __init__(self, **kwargs):
GraphScene.__init__(
self,
x_min=-5,
x_max=5,
y_min=-5,
y_max=5,
graph_origin=ORIGIN,
axes_color=GREEN)
def construct(self):
# Create Graph
self.setup_axes(animate=True)
f1 = self.get_graph(lambda x: cos(1/x) , x_min=-4, x_max=4)
# Construct the Figures
self.play(ShowCreation(f1))
self.wait(1)
Error:
Environment
OS System: Windows 10
manim version: master <V.6 Community Version>
python version: .3.7.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the supplied CreateGraph example with the intended cosine graph, focusing on the function passed to get_graph and its x range. Reproduce the result with the stated Manim, Python, and Windows environment, then confirm that the rendered graph matches the expected cosine curve.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100