<div dir="ltr">

<p class="MsoNormal" style="margin-bottom:12pt;line-height:normal"><span style="font-size:12pt;font-family:"times new roman","serif"" lang="EN-US">Dear all,</span></p>

<p class="MsoNormal" style="margin-bottom:12pt;line-height:normal"><span style="font-size:12pt;font-family:"times new roman","serif"" lang="EN-US">I recently upgraded to matplotlib 2.0 and found a regression with
RectangleSelector with drawtype='line'. A line is no longer draw between start
point and end point, but from lower left to upper right of an imaginary
rectangle. So you can no longer select a downward slope.<br>
<br>
This behavior may have been around for some time and most users will just use
RectangleSelector with a rectangle and not a line. There has been a mail on
this list regarding the return values only:<br>
<br>
<a href="http://matplotlib.1069221.n5.nabble.com/widgets-RectangleSelector-return-values-td47623.html">http://matplotlib.1069221.n5.nabble.com/widgets-RectangleSelector-return-values-td47623.html</a></span></p>

<p class="MsoNormal"><span style="font-size:12pt;line-height:115%;font-family:"times new roman","serif"" lang="EN-US">But also the interactive
drawing is affected. I looked into the corresponding code and found quite a lot
of sorting of x and y values separately. To restore the old behavior one would
need many changes to the worse from my point of view. <br></span></p><p class="MsoNormal"><span style="font-size:12pt;line-height:115%;font-family:"times new roman","serif"" lang="EN-US"><br></span></p><p class="MsoNormal"><span style="font-size:12pt;line-height:115%;font-family:"times new roman","serif"" lang="EN-US">Please note, that the
docstring for RectangleSelector still advertises the ‘line’-mode even if the ‘box’
mode is default now. This example clearly illustrates the problem.</span></p>

<p class="MsoNormal"><span style="font-size:12pt;line-height:115%;font-family:"times new roman","serif"" lang="EN-US">However, I suggest and request
for people like me, who want so select a line in a plot to add a LineSelector
instead of changing RectangleSelector to the old behavior and maybe break some
code for the ‘box’-mode again. This would be much more intuitive for new users.</span></p>

<p class="MsoNormal"><span style="font-size:12pt;line-height:115%;font-family:"times new roman","serif"" lang="EN-US"><br></span></p><p class="MsoNormal"><span style="font-size:12pt;line-height:115%;font-family:"times new roman","serif"" lang="EN-US">I added such a LineSelector
and attached a patch for widgets.py based on a much reduced copy of RectangleSelector. There
still is some code duplicated in the _release method, which could be resolved
with a common base class, but would require more changes. Additionally, there are
some changes in the docstring of RectangleSelector to use the box-mode and
change the print statement to clearly state that start point and end point are
no longer returned. In future one could add a deprecation warning and point users
to LineSelector if the RectangleSelector is used in line-mode.</span></p><p class="MsoNormal"><span style="font-size:12pt;line-height:115%;font-family:"times new roman","serif"" lang="EN-US"><br></span></p>

<p class="MsoNormal"><span style="font-size:12pt;line-height:115%;font-family:"times new roman","serif"" lang="EN-US">Best regards,</span></p>

<p class="MsoNormal"><span style="font-size:12pt;line-height:115%;font-family:"times new roman","serif"" lang="EN-US">Lars</span><span lang="EN-US"></span></p>

</div>