Skip to content

sort out if the high-resolution ellipse code still works #7491

Closed

Description

@tacaswell

I am not sure that the code at https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/patches.py#L1693 still does what it should do

Code originally went in via 7a82ea8

        for theta in thetas:
            if inside:
                self._path = Path.arc(last_theta, theta, 8)
                Patch.draw(self, renderer)
                inside = False
            else:
                inside = True
            last_theta = theta

was changed via b7479ef to

        for theta in thetas:
            if inside:
                _path = Path.arc(last_theta, theta, 8)
                Patch.draw(self, renderer)
                inside = False
            else:
                inside = True
            last_theta = theta

and changed via 1938b44 to

        for theta in thetas:
            if inside:
                Path.arc(last_theta, theta, 8)
                Patch.draw(self, renderer)
                inside = False
            else:
                inside = True
            last_theta = theta

attn @mdboom

Activity

  1. added this to the milestone on Nov 20, 2016
  2. dopplershift commented on Nov 21, 2016

    @dopplershift
    Contributor

    Wow. Seems like either it's wrong or doing unnecessary work.

  3. Kojoley commented on Nov 24, 2016

    @Kojoley
    Member

    I am getting the same output by comparing the outputs of:

    • reverting self._path = Path.arc(last_theta, theta, 8)
    • completely replace the whole draw body with return Patch.draw(self, renderer).

    What should happen if both width and height are lager than inv_error?

  4. modified the milestones: , on May 3, 2017
  5. modified the milestones: , on Oct 9, 2017
  6. tacaswell commented on Jun 4, 2020

    @tacaswell
    MemberAuthor

    This code is now

    path_original = self._path
    for theta in thetas:
    if inside:
    self._path = Path.arc(last_theta, theta, 8)
    Patch.draw(self, renderer)
    inside = False
    else:
    inside = True
    last_theta = theta
    # restore original path
    self._path = path_original
    and I think it is correct (if we have triggered this code path then we can only have one part of the arc going through the view box.

  7. modified the milestones: needs sorting, v3.3.0 on Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions