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

Skip to content

Commit fb4b910

Browse files
committed
Merge pull request #3015 from tacaswell/date_stem_simplefix
Date stem simplefix
2 parents 96f87f9 + 380fe29 commit fb4b910

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

CHANGELOG

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
2014-04-27 Improved input clean up in Axes.{h|v}lines
1111
Coerce input into a 1D ndarrays (after dealing with units).
1212

13+
2014-04-27 removed un-needed cast to float in stem
14+
1315
2014-04-22 Added an example showing the difference between
1416
interpolation = 'none' and interpolation = 'nearest' in
1517
`imshow()` when saving vector graphics files.
@@ -20,6 +22,10 @@
2022
2014-04-08 Fixed a bug in parasite_axes.py by making a list out
2123
of a generator at line 263.
2224

25+
2014-02-25 In backend_qt4agg changed from using update -> repaint under
26+
windows. See comment in source near `self._priv_update` for
27+
longer explaination.
28+
2329
2014-03-27 Added tests for pie ccw parameter. Removed pdf and svg images
2430
from tests for pie linewidth parameter.
2531

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2263,7 +2263,7 @@ def stem(self, *args, **kwargs):
22632263
self.hold(True)
22642264

22652265
# Assume there's at least one data array
2266-
y = np.asarray(args[0], dtype=np.float)
2266+
y = np.asarray(args[0])
22672267
args = args[1:]
22682268

22692269
# Try a second one

lib/matplotlib/tests/test_axes.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,6 +1636,19 @@ def test_stem_args():
16361636
ax.stem(x, y, 'r--', basefmt='b--')
16371637

16381638

1639+
@cleanup
1640+
def test_stem_dates():
1641+
fig, ax = plt.subplots(1, 1)
1642+
from dateutil import parser
1643+
x = parser.parse("2013-9-28 11:00:00")
1644+
y = 100
1645+
1646+
x1 = parser.parse("2013-9-28 12:00:00")
1647+
y1 = 200
1648+
1649+
ax.stem([x, x1], [y, y1], "*-")
1650+
1651+
16391652
@image_comparison(baseline_images=['hist_stacked_stepfilled_alpha'])
16401653
def test_hist_stacked_stepfilled_alpha():
16411654
# make some data

0 commit comments

Comments
 (0)