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

Skip to content

Trying to plot only error bars (with no line connecting data points) results in empty plot #8117

Closed
@anntzer

Description

@anntzer

mpl2.0, regression from 1.5.3 and thus marked as release critical, but feel free to relabel/remilestone.

plt.errorbar([1, 1.6], [3, 4], [5, 6], capsize=2, fmt="none")

1.5.3
153

2.0
20

The error bars are not visible in 2.0. Further inspection indicates that they are, in fact, drawn with the same color as the data line (that connects each data point), i.e., (0, 0, 0, 0).

Note that the docstring of errorbar is a bit inconsistent (emphasis mine):

fmt : plot format string, optional, default: None
The plot format symbol. If fmt is 'none' (case-insensitive),
only the errorbars are plotted. This is used for adding
errorbars to a bar plot, for example.

ecolor : mpl color, optional, default: None
A matplotlib color arg which gives the color the errorbar lines;
if None, use the color of the line connecting the markers.

A strict reading of the doc for ecolor suggests that the current behavior is "correct", but the doc of fmt clearly indicates that this is not the intent.

Metadata

Metadata

Assignees

Labels

Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions