From 5b60046f674d0e26cde8d31f4e999c30216b1cf4 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Thu, 16 Jan 2014 12:40:26 -0500 Subject: [PATCH] BUG : errorbar does not respect `lines.linestyle` rcparam changed default value of `fmt` from '-' -> '' fixes issue #2366 Fix that does minimal amount of reverse compatible breakage. I think the only scenario where this will be a problem are cases where users have set a non-default value for `lines.linestyle`, but do not want the lines drawn by `errorbar` to respect that. I think that this use case is broken because `lines.linestyle` should be respected by plotting functions which draw lines. --- CHANGELOG | 3 +++ doc/api/api_changes.rst | 10 ++++++++++ lib/matplotlib/axes.py | 3 +-- lib/matplotlib/pyplot.py | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8d2c91c224cb..96bb0dde1ad7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2014-01-15 changed default value of `fmt` kwarg of `errorbar` from '-' -> '' so + that `errorbar` will respect `lines.linestyle` for drawing the line. + 2013-05-18 Added support for arbitrary rasterization resolutions to the SVG backend. Previously the resolution was hard coded to 72 dpi. Now the backend class takes a image_dpi argument for diff --git a/doc/api/api_changes.rst b/doc/api/api_changes.rst index ed6803131d75..c791d887da7d 100644 --- a/doc/api/api_changes.rst +++ b/doc/api/api_changes.rst @@ -17,6 +17,16 @@ For new features that were added to matplotlib, please see Changes in 1.3.x ================ +* changed default value of `fmt` kwarg of `errorbar` from `'-'` to + `''` so that `errorbar` will respect `lines.linestyle` for drawing + the line. I think the only scenario where this will break reverse + compatibility is cases where users have set a non-default value for + `lines.linestyle`, but do not want the lines drawn by `errorbar` to + respect that. I think that this use case is broken because + `lines.linestyle` should be respected by plotting functions which + draw lines. + + Changes in 1.3.1 ---------------- diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index db671e7967c2..d3c2d3c9dd22 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -5484,7 +5484,7 @@ def pie(self, x, explode=None, labels=None, colors=None, @docstring.dedent_interpd def errorbar(self, x, y, yerr=None, xerr=None, - fmt='-', ecolor=None, elinewidth=None, capsize=3, + fmt='', ecolor=None, elinewidth=None, capsize=3, barsabove=False, lolims=False, uplims=False, xlolims=False, xuplims=False, errorevery=1, capthick=None, **kwargs): @@ -5586,7 +5586,6 @@ def errorbar(self, x, y, yerr=None, xerr=None, .. plot:: mpl_examples/statistics/errorbar_demo.py """ - if errorevery < 1: raise ValueError( 'errorevery has to be a strictly positive integer') diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 3300183aae2f..20219e664be6 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -2679,7 +2679,7 @@ def csd(x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost @_autogen_docstring(Axes.errorbar) -def errorbar(x, y, yerr=None, xerr=None, fmt='-', ecolor=None, elinewidth=None, +def errorbar(x, y, yerr=None, xerr=None, fmt='', ecolor=None, elinewidth=None, capsize=3, barsabove=False, lolims=False, uplims=False, xlolims=False, xuplims=False, errorevery=1, capthick=None, hold=None, **kwargs):