Skip to content

[Doc]: Clarify default capstyle #21979

@StefRe

Description

@StefRe

Documentation Link

https://matplotlib.org/devdocs/api/_enums_api.html#matplotlib._enums.CapStyle

Problem

The demo states that the default capstyle is projecting, which is true for Line2D but not for PathPatch (where the default is 'butt').

import matplotlib.pyplot as plt
import matplotlib as mpl

fig,ax = plt.subplots(figsize=(2,1), layout='constrained')

xx = [0, 1]
yy = [0, 0]
ax.plot(xx, yy, lw=12, color='tab:blue')
ax.plot(xx, yy, lw=1, color='black')
ax.plot(xx, yy, 'o', color='tab:red', markersize=3)
ax.add_patch(mpl.patches.PathPatch(mpl.path.Path([[0, 0],[1, 0]]), lw=20, color='C1'))
ax.set_axis_off()

Figure_6

(see also https://stackoverflow.com/a/70381813/3944322)

Suggested improvement

Change (default) to (default for Line2D) in

ax.text(2.25, 0.55, '(default)', ha='center')

Matplotlib Version

3.5.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy