I looked into the matplotlib.transforms module but haven't figured out how to achieve all the following targets at the same time.
- plot a curve with x and y coordinates in list x and y.
- plot a rectangle (matplotlib.patches.Rectangle) that sticks to the bottom left corner
- width of the rectangle is 10% of horizontal axis (xmax-xmin).
- height is 1, meaning a unit height rectangle
- the rectangle sticks to the bottom left corner, when plot is moved/zoomed.
- the rectangle's width remains 10% of horizontal axis 0.1*(xmax-xmin) when zoomed
- the rectangle's height changes consistently with y-axis when zoomed.
It seems that along the horizontal direction, scale and position are both in axes.transAxes, which is easy to do. However, along the vertical direction, I need scale to be in axes.transData, but position in axes.transAxes. If I give up item 5, I can use the transforms.blended_transform_factory(), to have axes.transAxes on horizontal and axes.transData on vertical direction, in which case if I zoom, the height of the rectangle changes correctly, but it might go out-of-sight, either partially or completely, in the vertical direction.
Does anyone know if this is doable without hacking too much into matplotlib?
