Skip to content

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

Closed
@oscargus

Description

@oscargus

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions