Add PlotShadedClip, fills region only if the second line is higher than the first one.#161
Open
WildRackoon wants to merge 1 commit intoepezent:masterfrom
Open
Add PlotShadedClip, fills region only if the second line is higher than the first one.#161WildRackoon wants to merge 1 commit intoepezent:masterfrom
WildRackoon wants to merge 1 commit intoepezent:masterfrom
Conversation
Owner
|
@WildRackoon , thanks for the PR. This looks useful! I'll try to take a look soon (currently swamped with school). |
0962a21 to
3c7ec60
Compare
Closed
b6028ec to
a47192d
Compare
a47192d to
19e443c
Compare
Author
|
Rebased this to latest code changes just in case anyone needs this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.