Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DOC]: clarify that markevery[float] considers path length along drawn line #27842

Description

@ma-sadeghi

Bug summary

markevery[float] is supposed to result in evenly distributed markers, but when y-data is noisy, its effect seems to "gradually" fade away.

Code for reproduction

import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(1e3, 1e7, 1000)

fig, ax = plt.subplots(nrows=3, ncols=3, figsize=(9, 9), layout="constrained")

for i, ax_i in enumerate(ax.flatten()):
    ax_i.set_title(f"noise level = {i/5:.1f}")
    y = np.exp(x**0.1) + np.random.rand(len(x)) * i/2
    ax_i.plot(x, y, 'b.-', markevery=0.1, ms=10, markerfacecolor="r")
    ax_i.set_xscale("log")
    ax_i.set_yscale("log")

Actual outcome

image

Expected outcome

All subplots be like the one with 0 noise level.

Additional information

No response

Operating system

Ubuntu

Matplotlib Version

3.8.3

Matplotlib Backend

matplotlib_inline.backend_inline

Python version

3.10.13

Jupyter version

No response

Installation

pip

Activity

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