From 6ca8063f8283d00dd1508991512d8a7e280c3ae1 Mon Sep 17 00:00:00 2001 From: Vincent Cuenca Date: Wed, 16 Mar 2016 17:54:04 -0400 Subject: [PATCH 01/11] #5856: added option to create vertically-oriented stem plots --- lib/matplotlib/axes/_axes.py | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 49d755ae1954..fb9afde6f008 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2367,11 +2367,14 @@ def stem(self, *args, **kwargs): stem(y, linefmt='b-', markerfmt='bo', basefmt='r-') stem(x, y, linefmt='b-', markerfmt='bo', basefmt='r-') - A stem plot plots vertical lines (using *linefmt*) at each *x* + A stem plot, by default, plots vertical lines (using *linefmt*) at each *x* location from the baseline to *y*, and places a marker there using *markerfmt*. A horizontal line at 0 is is plotted using *basefmt*. + It is possible to create a vertically-oriented stem plot + by providing vertical=True. + If no *x* values are provided, the default is (0, 1, ..., len(y) - 1) Return value is a tuple (*markerline*, *stemlines*, @@ -2420,22 +2423,38 @@ def stem(self, *args, **kwargs): except IndexError: basefmt = kwargs.pop('basefmt', 'r-') + # Check if the user wants a vertical stem plot + vertical = kwargs.pop('vertical', None) + if vertical is None: + vertical = False + bottom = kwargs.pop('bottom', None) label = kwargs.pop('label', None) - markerline, = self.plot(x, y, markerfmt, label="_nolegend_") + if vertical: + markerline, = self.plot(y, x, markerfmt, label="_nolegend_") + else: + markerline, = self.plot(x, y, markerfmt, label="_nolegend_") if bottom is None: bottom = 0 stemlines = [] for thisx, thisy in zip(x, y): - l, = self.plot([thisx, thisx], [bottom, thisy], linefmt, - label="_nolegend_") + if vertical: + l, = self.plot([bottom, thisy], [thisx, thisx], linefmt, + label="_nolegend_") + else: + l, = self.plot([thisx, thisx], [bottom, thisy], linefmt, + label="_nolegend_") stemlines.append(l) - baseline, = self.plot([np.amin(x), np.amax(x)], [bottom, bottom], - basefmt, label="_nolegend_") + if vertical: + baseline, = self.plot([bottom, bottom], [np.amin(x), np.amax(x)], + basefmt, label="_nolegend_") + else: + baseline, = self.plot([np.amin(x), np.amax(x)], [bottom, bottom], + basefmt, label="_nolegend_") self.hold(remember_hold) From e93cd3eb3881299b3dbe8ffeb40f7388ef305ef2 Mon Sep 17 00:00:00 2001 From: Vincent Cuenca Date: Thu, 17 Mar 2016 12:23:47 -0400 Subject: [PATCH 02/11] Added docstrings for optional args in stem, made vertical default to false --- lib/matplotlib/axes/_axes.py | 40 +++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index fb9afde6f008..ad1c635ea938 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2367,27 +2367,45 @@ def stem(self, *args, **kwargs): stem(y, linefmt='b-', markerfmt='bo', basefmt='r-') stem(x, y, linefmt='b-', markerfmt='bo', basefmt='r-') - A stem plot, by default, plots vertical lines (using *linefmt*) at each *x* + A stem plot plots vertical lines (using *linefmt*) at each *x* location from the baseline to *y*, and places a marker there using *markerfmt*. A horizontal line at 0 is is plotted using *basefmt*. - It is possible to create a vertically-oriented stem plot - by providing vertical=True. - If no *x* values are provided, the default is (0, 1, ..., len(y) - 1) - Return value is a tuple (*markerline*, *stemlines*, - *baseline*). + Optional parameters: + -------------------- + linefmt : line format string + Format for the lines protruding from the baseline to the + stem markers. + + markerfmt: marker format string + Format for the markers. + + basefmt: line format string + Format for the baseline. + + vertical: bool, optional (False) + If 'True', will produce a vertically-oriented stem plot. + + bottom: num, optional (0) + The location of the base line. + + label: string + Label for the stem container returned. + + Returns + ------- + The return value is ``(markerline, stemlines, baseline)``. .. seealso:: This `document `_ for details. - - **Example:** - + Examples + -------- .. plot:: mpl_examples/pylab_examples/stem_plot.py """ remember_hold = self._hold @@ -2424,9 +2442,7 @@ def stem(self, *args, **kwargs): basefmt = kwargs.pop('basefmt', 'r-') # Check if the user wants a vertical stem plot - vertical = kwargs.pop('vertical', None) - if vertical is None: - vertical = False + vertical = kwargs.pop('vertical', False) bottom = kwargs.pop('bottom', None) label = kwargs.pop('label', None) From 2b9e65f54f371736b85bd76f4b8262bd0776919f Mon Sep 17 00:00:00 2001 From: Vincent Cuenca Date: Thu, 17 Mar 2016 12:59:54 -0400 Subject: [PATCH 03/11] Added flipping and renamed xs and ys in stem --- lib/matplotlib/axes/_axes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index ad1c635ea938..2591015674e0 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2448,9 +2448,9 @@ def stem(self, *args, **kwargs): label = kwargs.pop('label', None) if vertical: - markerline, = self.plot(y, x, markerfmt, label="_nolegend_") - else: - markerline, = self.plot(x, y, markerfmt, label="_nolegend_") + x, y = y, x + + markerline, = self.plot(x, y, markerfmt, label="_nolegend_") if bottom is None: bottom = 0 @@ -2458,7 +2458,7 @@ def stem(self, *args, **kwargs): stemlines = [] for thisx, thisy in zip(x, y): if vertical: - l, = self.plot([bottom, thisy], [thisx, thisx], linefmt, + l, = self.plot([bottom, thisx], [thisy, thisy], linefmt, label="_nolegend_") else: l, = self.plot([thisx, thisx], [bottom, thisy], linefmt, @@ -2466,7 +2466,7 @@ def stem(self, *args, **kwargs): stemlines.append(l) if vertical: - baseline, = self.plot([bottom, bottom], [np.amin(x), np.amax(x)], + baseline, = self.plot([bottom, bottom], [np.amin(y), np.amax(y)], basefmt, label="_nolegend_") else: baseline, = self.plot([np.amin(x), np.amax(x)], [bottom, bottom], From 6c406f47f1bec0beb4669a143dd7990ab22cabeb Mon Sep 17 00:00:00 2001 From: ItsRLuo Date: Thu, 17 Mar 2016 15:27:32 -0400 Subject: [PATCH 04/11] Changed orientation variable to string from boolean, also modified documentation for the change --- lib/matplotlib/axes/_axes.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 2591015674e0..900c471b0773 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2364,8 +2364,10 @@ def stem(self, *args, **kwargs): Call signatures:: - stem(y, linefmt='b-', markerfmt='bo', basefmt='r-') - stem(x, y, linefmt='b-', markerfmt='bo', basefmt='r-') + stem(y, linefmt='b-', markerfmt='bo', basefmt='r-', + orientation = {'horizontal'|'vertical'}) + stem(x, y, linefmt='b-', markerfmt='bo', basefmt='r-', + orientation = {'horizontal'|'vertical'}) A stem plot plots vertical lines (using *linefmt*) at each *x* location from the baseline to *y*, and places a marker there @@ -2386,8 +2388,9 @@ def stem(self, *args, **kwargs): basefmt: line format string Format for the baseline. - vertical: bool, optional (False) - If 'True', will produce a vertically-oriented stem plot. + vertical: string, optional (horizontal) + If 'vertical', will produce a vertically-oriented stem plot, + else it will produce a horizontally-oriented stem plot. bottom: num, optional (0) The location of the base line. @@ -2441,13 +2444,14 @@ def stem(self, *args, **kwargs): except IndexError: basefmt = kwargs.pop('basefmt', 'r-') - # Check if the user wants a vertical stem plot - vertical = kwargs.pop('vertical', False) + # Check the orientation variable to see if the user + # wants a vertical or horizontal stem plot + orientation = kwargs.pop('orientation', 'horizontal') bottom = kwargs.pop('bottom', None) label = kwargs.pop('label', None) - if vertical: + if orientation == 'vertical': x, y = y, x markerline, = self.plot(x, y, markerfmt, label="_nolegend_") @@ -2457,7 +2461,7 @@ def stem(self, *args, **kwargs): stemlines = [] for thisx, thisy in zip(x, y): - if vertical: + if orientation == 'vertical': l, = self.plot([bottom, thisx], [thisy, thisy], linefmt, label="_nolegend_") else: @@ -2465,7 +2469,7 @@ def stem(self, *args, **kwargs): label="_nolegend_") stemlines.append(l) - if vertical: + if orientation == 'vertical': baseline, = self.plot([bottom, bottom], [np.amin(y), np.amax(y)], basefmt, label="_nolegend_") else: From 56fd706a98590476a39d052e5c67590d7ae76af8 Mon Sep 17 00:00:00 2001 From: ItsRLuo Date: Thu, 17 Mar 2016 15:38:38 -0400 Subject: [PATCH 05/11] Flipped thisx to thisy and vice versa when the orientation value is vertical --- lib/matplotlib/axes/_axes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 900c471b0773..853c8b8cf648 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2462,7 +2462,8 @@ def stem(self, *args, **kwargs): stemlines = [] for thisx, thisy in zip(x, y): if orientation == 'vertical': - l, = self.plot([bottom, thisx], [thisy, thisy], linefmt, + thisx, thisy = thisy, thisx + l, = self.plot([bottom, thisy], [thisx, thisx], linefmt, label="_nolegend_") else: l, = self.plot([thisx, thisx], [bottom, thisy], linefmt, From ed192812f1b894849ec153cf3364e095d074ac62 Mon Sep 17 00:00:00 2001 From: ItsRLuo Date: Thu, 17 Mar 2016 15:44:41 -0400 Subject: [PATCH 06/11] Flipped x to y and vice versa for the baseline plot --- lib/matplotlib/axes/_axes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 853c8b8cf648..3de622e19fb5 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2471,7 +2471,8 @@ def stem(self, *args, **kwargs): stemlines.append(l) if orientation == 'vertical': - baseline, = self.plot([bottom, bottom], [np.amin(y), np.amax(y)], + x, y = y, x + baseline, = self.plot([bottom, bottom], [np.amin(x), np.amax(x)], basefmt, label="_nolegend_") else: baseline, = self.plot([np.amin(x), np.amax(x)], [bottom, bottom], From 032ff4ee8d9ca34893b3799f077583d4b59607d6 Mon Sep 17 00:00:00 2001 From: ItsRLuo Date: Thu, 17 Mar 2016 15:47:15 -0400 Subject: [PATCH 07/11] removed trailing whitespace --- lib/matplotlib/axes/_axes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 3de622e19fb5..54bda0170922 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2444,7 +2444,7 @@ def stem(self, *args, **kwargs): except IndexError: basefmt = kwargs.pop('basefmt', 'r-') - # Check the orientation variable to see if the user + # Check the orientation variable to see if the user # wants a vertical or horizontal stem plot orientation = kwargs.pop('orientation', 'horizontal') From 9ed1e2ebc187747ddb51a7979193eef37f0460a0 Mon Sep 17 00:00:00 2001 From: Vincent Cuenca Date: Mon, 21 Mar 2016 00:54:06 -0400 Subject: [PATCH 08/11] Added some validation for the orientation arg in stem() --- lib/matplotlib/axes/_axes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 54bda0170922..a2c1c1c270a1 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2448,6 +2448,9 @@ def stem(self, *args, **kwargs): # wants a vertical or horizontal stem plot orientation = kwargs.pop('orientation', 'horizontal') + if orientation not in ('horizontal', 'vertical'): + raise ValueError("'%s' is not a valid orientation" % orientation) + bottom = kwargs.pop('bottom', None) label = kwargs.pop('label', None) From 9570dfae512779d6b371e6411df883880e96af00 Mon Sep 17 00:00:00 2001 From: Vincent Cuenca Date: Tue, 22 Mar 2016 13:30:18 -0400 Subject: [PATCH 09/11] Added whats_new entry for #5856 --- doc/users/whats_new/stem_orientation.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/users/whats_new/stem_orientation.rst diff --git a/doc/users/whats_new/stem_orientation.rst b/doc/users/whats_new/stem_orientation.rst new file mode 100644 index 000000000000..94b292284674 --- /dev/null +++ b/doc/users/whats_new/stem_orientation.rst @@ -0,0 +1,11 @@ +Added ``orientation`` parameter for stem plots +----------------------------------- +When creating stem plots, you can now pass in an ``orientation`` argument to :func:`stem`. + +Currently, only ``vertical`` and ``horizontal`` orientations are supported, +with ``horizontal`` being the default. + +Example +``````` +:: + stem(x, x, orientation='vertical') From bd7c878b05bb711c0ddaf286e6c1970712fcea57 Mon Sep 17 00:00:00 2001 From: Vincent Cuenca Date: Tue, 22 Mar 2016 18:47:13 -0400 Subject: [PATCH 10/11] Added stem orientation test and associated baseline images --- .../test_axes/stem_orientation.pdf | Bin 0 -> 7016 bytes .../test_axes/stem_orientation.png | Bin 0 -> 12269 bytes .../test_axes/stem_orientation.svg | 598 ++++++++++++++++++ lib/matplotlib/tests/test_axes.py | 4 + 4 files changed, 602 insertions(+) create mode 100644 lib/matplotlib/tests/baseline_images/test_axes/stem_orientation.pdf create mode 100644 lib/matplotlib/tests/baseline_images/test_axes/stem_orientation.png create mode 100644 lib/matplotlib/tests/baseline_images/test_axes/stem_orientation.svg diff --git a/lib/matplotlib/tests/baseline_images/test_axes/stem_orientation.pdf b/lib/matplotlib/tests/baseline_images/test_axes/stem_orientation.pdf new file mode 100644 index 0000000000000000000000000000000000000000..88330dfed96d3d8792ac348bd0b110fcd050bbd4 GIT binary patch literal 7016 zcmb_h30zF;`!DUMEUmUKM=823bLPyPS<=3#+p2}^P196UYBDpWMUf>UL?RTI=oh)R zx)+hU2rZPPC_6Vx5*J05e(!sxsY(7mKEKa@=JU*Z&U@bXd7tfk-}iaO$j8aWoN7Tw zj1J#Hi%JnHilKtw2*ks#FXTjvVmLxxG&e!2s${&44b&Ap5KELrD4x6!KF2{24@8IT2_^%j({L!G zeRQ-yECT)D+LtF1#0t5bE&_Y2=S>oScK%N{H}t&;UP)GBtRuh7k0*YiK`zf$5# zH?VbnS+CyJUiRgJO=~;z99u=Hr|0+Ht@Y`6#My*fOJ{rzRdso)9k$0&xg=NL*Qv|R zpyfYM$F)aRv2RWD-U6#LN^KLu8+(O8Pg<~`-R|^mDZQEW*1Cb+Ym5Hs>S=C>e%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a/lib/matplotlib/tests/baseline_images/test_axes/stem_orientation.png b/lib/matplotlib/tests/baseline_images/test_axes/stem_orientation.png new file mode 100644 index 0000000000000000000000000000000000000000..515b336f1dc0c3225b8a837249449e0c23080bb6 GIT binary patch literal 12269 zcmd^_2UJt*)~**t5iA&~N(n_p0YOxHRS>MO5fP9oMO2zd4K)@df`E#G3IqfJ1?kd5 zaSH_LMJdvhP!))wh0Z^hp8Nl&?7PnxcZ_rI8Rt55sEcG}<@>(*&UZd@-uq2gXDiz- zHUvSoo;;y-4ndfN5QNcq(?+=R-1F9T_>0-?*va#o;FsSfTLS!__4)}DHw0n7g#KZ8 zrJi~fL4=T#T1U@&$4>V7KJD;`Tc^=gw+vn>jJ(Gp;=b3&hS}gnFCoBj11m=Glv7Nl zK~KTp@uF9g!d)+K6*R;;eBPT@)}eVdlGPWtQF1?r*Y9UlUWTRLiwrJ0^5h3Mi!hZ+ zW#1-yNN5v%R5_STDIpcD^dF|(D(^g?S5BvwZ#IdtV?dAx8ixH$2!dbJ#KTj5*t8uU zYbOIEg6tO6fXlYbo8UF~5qRYzj1Yoo9AacfkQ3VfAHDe5HxkS2arO1ZW=dhj>ZB)D zeRZ}ysh~jas|bRO?PP;>#6^rbq@0c6?lf~dTNtsG_n^>)EDHe^L2s);Ls&j_hI0(V zHx%oJZ$#UC@5l&!p&49LQ85jC#0o`r=^wjTez*xb&^Xwz7J01 zH8e%FI7mwVlstJ{)K zCuL?zUAuN|#{p)<%HG4%Q(H$z=S-}E%tm&>SbD6*hqGf`^Lg>Bl1fTSgO5&2;rg=7 zOWd!XiIF?-P8>lz$)AiY1q@Pk8-2C2c58@F)JbIBXJFb`wbMS9R$^&tWWCZH~Wp183cTcxej*qek_L^Z5JLgHG=ELwpDOd7sev@$zHJIQB6EkQFWiqr!2r zLuUAxW32~UC7+yKU2%@j+^rwe>8c<`zsbnT#soNCAzWu*9?Q^Gp8RsinWQ;SIjK zAaIZ2&(}Veb+E2`yq~7NKBF$C{x-{qdVN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SzQBhG7 zFroPYHX?7hK00+JxrNEGw@60$+pDBp&25UiO>=EeLI#eo<1u&F2Q5XDc!s4sKygq% zSOZ5@^g!9)W?^p%SNis90+h2(5V9NE2t-p9jHb>k47c2#Y$~2ddxj3zuGOJj$`N$B zJ8*3@@G@#hpuv<|9m+FGtAD|R4uIsLD=``$7yzHBI2xNb*L=-Xt*XtfX9`kGD8YGs zC!FW#tnX9oL1?b%b=C2NyyLuD4l$};3hjw=jj24~bOR#GX5y&5KA9gsezZknw_vdZ z)&WgzaIDOmT4DE>BfQm7&o=>wd%#Bxbs;f_?RBHG#;4TV;O^^?!(s%0)0CEcs1fJI!8GTdnjbIO>?1(+{caBAsHO-y! zA;EE*oSX#uR|61&010bY^`79wLmk0;AVa{)luP{UD<@4#J)O`o9NKifG#Qn$7EShy zFQIyv~pvO?`HJGQ)$CGB^IvWIRNU~M?`R4~$Iv**y6 vL30adwkKbToko96hX1SP*8Uwv%Ga@5#yR3H5R;pM0U#%j>uO~lv%2+PCDZ`X literal 0 HcmV?d00001 diff --git a/lib/matplotlib/tests/baseline_images/test_axes/stem_orientation.svg b/lib/matplotlib/tests/baseline_images/test_axes/stem_orientation.svg new file mode 100644 index 000000000000..34ba521a909f --- /dev/null +++ b/lib/matplotlib/tests/baseline_images/test_axes/stem_orientation.svg @@ -0,0 +1,598 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 379a62405597..48cebf8a5ac4 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -2348,6 +2348,10 @@ def test_stem_dates(): ax.stem([x, x1], [y, y1], "*-") +@image_comparison(baseline_images=['stem_orientation']) +def test_stem_orientation(): + x = np.linspace(0.1, 2*np.pi, 10) + plt.stem(x, np.cos(x), orientation='vertical') @image_comparison(baseline_images=['hist_stacked_stepfilled_alpha']) def test_hist_stacked_stepfilled_alpha(): From b161f1860c54d8c2771993060b3aac296d12db93 Mon Sep 17 00:00:00 2001 From: Vincent Cuenca Date: Thu, 24 Mar 2016 17:23:22 -0400 Subject: [PATCH 11/11] Fixed whats_new entry --- doc/users/whats_new/stem_orientation.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/users/whats_new/stem_orientation.rst b/doc/users/whats_new/stem_orientation.rst index 94b292284674..3495333aa109 100644 --- a/doc/users/whats_new/stem_orientation.rst +++ b/doc/users/whats_new/stem_orientation.rst @@ -7,5 +7,4 @@ with ``horizontal`` being the default. Example ``````` -:: - stem(x, x, orientation='vertical') +stem(x, x, orientation='vertical')