Add PlotShadedClip, fills region only if the second line is higher than the first one. #161
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PlotShaded only supports a single color for the overlap region, It could use a segregation based on a quantity being higher than another.
Here is a Simple example, used to visually assert wether a stock market's limit orders are appropriate for transactions to be done:
This is achieved by two PlotShadedClip calls, one from ys1 to ys2 and a second from ys2 to ys1;
The Implementation is very basic, it comes down to 2 modified lines in comparison with PlotShaded, upper vertices coords are squeezed down if relative height conditions are not met.
This PR only a baseline for a better implementation of this kind of feature, it also only does ShadeClipping between two series, not with a single serie and a ref, simply because I didn't know how to elegantly handle the choice between a shaded region above or under the reference line. (switching positional arguments doesn't seem very clean to me, but its work).
EDIT: I mean extending this to lines, scatter etc... and have dual/multi color thresholds would need significant changes.
Looking forward to your suggestions.