FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Doc]: Oscilloscope demo x-axis offset · Issue #24476 · matplotlib/matplotlib · GitHub

Repository navigation

[Doc]: Oscilloscope demo x-axis offset #24476

Closed

Description

Documentation Link

https://matplotlib.org/devdocs/gallery/animation/strip_chart.html

Problem

The demo starts off by displaying the range 0 to 2, then 2 to 4 and so on, but after a while an offset is introduced, which I assume is unwanted. For example, the 20th updates goes to 40.25 (probably a bit more) rather than 40.

No big deal and probably just a one-off error (or a floating-point effect), but I was just about to point a colleague to this and realized that something was not as one could hope for.

Note that one will have to run it locally to see the effect. (The online version can probably be slightly improved though as it just starts redrawing before starting all over again.)

Suggested improvement

Fix the code so that it always increment the range by 2 (or t rather). One may think of skipping the dt and instead use number of points per display (t/dt).

Activity

  1. oscargus commented on Nov 16, 2022

    MemberAuthor

    Seems to be a floating-point issue as these are the values for the first lower x-limits:

    2.0000000000000013
    4.000000000000003
    6.01999999999996
    8.039999999999917
    10.059999999999874
    12.079999999999831
    14.099999999999788
    16.119999999999745
    18.139999999999702

  2. added this to the v3.6-doc milestone on Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL