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

Backport PR #15166 on branch v3.1.x by dstansby · Pull Request #15172 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 2 additions & 2 deletions lib/matplotlib/axes/_axes.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2163,12 +2163,12 @@ def _convert_dx(dx, x0, xconv, convert):
# removes the units from unit packages like `pint` that
# wrap numpy arrays.
try:
x0 = x0[0]
x0 = cbook.safe_first_element(x0)
except (TypeError, IndexError, KeyError):
x0 = x0

try:
x = xconv[0]
x = cbook.safe_first_element(xconv)
except (TypeError, IndexError, KeyError):
x = xconv

Expand Down
8 changes: 8 additions & 0 deletions lib/matplotlib/tests/test_axes.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1592,6 +1592,14 @@ def test_bar_pandas(pd):
ax.plot(dates, baseline, color='orange', lw=4)


def test_bar_pandas_indexed(pd):
# Smoke test for indexed pandas
df = pd.DataFrame({"x": [1., 2., 3.], "width": [.2, .4, .6]},
index=[1, 2, 3])
fig, ax = plt.subplots()
ax.bar(df.x, 1., width=df.width)


@image_comparison(baseline_images=['hist_log'],
remove_text=True)
def test_hist_log():
Expand Down

Back | FazBrowse Home | New Git URL