Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed :class:.Axes scaling for :meth:.plot_implicit_curve #3195

Merged
merged 2 commits into from
Mar 28, 2023

Conversation

JinchuLi2002
Copy link
Contributor

Closes #3145

Overview

Initially, calling plot_implicit_curve() on a CoordinateSystem whose axes were scaled would have no effect, as if the axes hadn't been scaled at all. This PR fixed it by applying the scalings when creating ImplicitFunction object under plot_implicit_curve()

Further Information and Comments

Test code:

from manim import *


class Test(Scene):
    def construct(self):
        numberplane = NumberPlane(
            axis_config=dict(
                scaling=LinearBase(scale_factor=0.5),
                decimal_number_config=dict(
                    num_decimal_places=1,
                ),
            ),
        ).add_coordinates()

        unit_circle = numberplane.plot_implicit_curve(
            lambda x, y: (x) ** 2 + (y) ** 2 - 1, color=BLUE
        )

        self.add(numberplane, unit_circle)

Original output (incorrect):

image

New output:

Screen Shot 2023-03-27 at 7 30 46 PM

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

@behackl behackl added the pr:bugfix Bug fix for use in PRs solving a specific issue:bug label Mar 27, 2023
@JinchuLi2002 JinchuLi2002 marked this pull request as ready for review March 27, 2023 23:36
Copy link
Member

@behackl behackl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine to me, thanks for the fix!

@behackl behackl merged commit 479e7b6 into ManimCommunity:main Mar 28, 2023
@behackl behackl changed the title Fix: Axes Scaling Had No Effect on plot_implicit_curve() Fixed :class:.Axes scaling for :meth:.plot_implicit_curve Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:bugfix Bug fix for use in PRs solving a specific issue:bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

NumberPlane plot_implicit_curve method doesnot respect 'scaling' factor of Axes
2 participants