Issue 1:
Bug report

The coordinates reported for eclick and erelease from the onselect callback function don't match what was actually clicked on when drawing a rectangle with RectangleSelector

Code for reproduction

from matplotlib.backend_bases import MouseButton, MouseEvent
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.widgets import RectangleSelector

xdata = np.linspace(0,9*np.pi, num=301)
ydata = np.sin(xdata)

def rect_coords_from_clicks(eclick, erelease):
x1, y1 = eclick.xdata, eclick.ydata
x2, y2 = erelease.xdata, erelease.ydata
print(f"You pressed at {(x1,y1)}, and released at {(x2,y2)}.")

def on_press(event):
print(f"You pressed {str(event.button)} at {(event.xdata, event.ydata)}.")

def on_release(event):
print(f"You released {str(event.button)} at {(event.xdata, event.ydata)}.")

fig, ax = plt.subplots()
line, = ax.plot(xdata, ydata)

rs = RectangleSelector(ax, rect_coords_from_clicks, button=[MouseButton.LEFT])

plt.connect('button_press_event', on_press)
plt.connect('button_release_event', on_release)

plt.show()

Actual outcome

clicking the left mousebutton at ~(0,0), dragging the rectangle to ~(25,-1) and then releasing results in the following

You pressed MouseButton.LEFT at (0.028502352703939415, -0.009523809523809268).
You pressed at (0.028502352703938527, -0.9976190476190476), and released at (24.922457204324836, -0.009523809523809268).
You released MouseButton.LEFT at (24.922457204324836, -0.9976190476190476).

clicking the left mousebutton at ~(25,1), dragging the rectangle to ~(0,0) and then releasing results in the following

You pressed MouseButton.LEFT at (25.04786755622217, -0.9797619047619047).
You pressed at (0.028502352703938527, -0.9797619047619047), and released at (25.04786755622217, 0.0023809523809525945).
You released MouseButton.LEFT at (0.028502352703939415, 0.0023809523809525945).

The coordinates of click and release aren't respected by the onselect function of RectangleSelector: the "click" coordinate is always the bottom left corner of the rectangle and the "release" coordinate is always the top right corner.

The coordinates given by the on_press and on_release functions are always correct.

Expected outcome

clicking the left mousebutton at ~(0,0), dragging the rectangle to ~(25,-1) and then releasing results in the following

You pressed MouseButton.LEFT at (0.028502352703939415, -0.009523809523809268).
You pressed at (0.028502352703939415, -0.009523809523809268), and released at (24.922457204324836, -0.9976190476190476).
You released MouseButton.LEFT at (24.922457204324836, -0.9976190476190476).

clicking the left mousebutton at ~(25,1), dragging the rectangle to ~(0,0) and then releasing results in the following

You pressed MouseButton.LEFT at (25.04786755622217, -0.9797619047619047).
You pressed at (25.04786755622217, -0.9797619047619047), and released at (0.028502352703939415, 0.0023809523809525945).
You released MouseButton.LEFT at (0.028502352703939415, 0.0023809523809525945).

The coordinates reported by eclick and erelease should match the actual click and release coordinate.

Matplotlib version

Operating system: Windows 10

Matplotlib version: 3.4.2

Matplotlib backend: Qt5Agg

Python version: 3.9.4

Issue 2:
Bug report

In Python 3.6.3 and the related matplotlib (just compiled from sources) the RectangleSelector does no longer behave as in Python 2.7 and as is described. Instead of returning the mouse click coordinates in the event variable eclick and the release coordinates in erelease it returns the lower left corner in eclick and the upper right corner in erelease. This "normalization" reduces the information content and, thus, the usability of the selector. Only using the old version a user can switch to drawmode='line' and use the selector to input a displacement vector.