-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Truncation #198
Open
tgwoodcock
wants to merge
20
commits into
marcharper:master
Choose a base branch
from
tgwoodcock:truncation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Truncation #198
Conversation
This file contains 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
Ensured that TernaryAxesSubplot.line passes the self._permutation through to ternary.lines.line
Some plots are mostly in one region of the simplex and using truncation, we can cut off one or more corners of the simplex to save whitespace.
These functions now handle truncation too.
We now have axis_min_max as n attribute during init, therefore we don't need to check for it in the functions for droawing the boundary and the gridlines both in lines and in ternary_axes_subplot. Also updated or added some docstrings to some functions.
The function get_truncation was previously in one of the minor modules but I have now moved it to ternary_axes_subplot as it makes much more sence. This function has been rewritten and is now called set_truncation, with get_truncation now simply returning self._truncation, in alignment with other functions.
Refactorted set_custom_ticks and added docstrings to several functions.
Updated the custom_axis_scaling and truncated_simplex_example scripts and added 3 images from these scripts to the readme_images folder.
Thanks! I've been quite busy but will try to take a look soon. |
Replaced sm._A = [] with sm.set_array(None) as the former was causing an error with plt.cm.ScalarMappable
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.
This PR includes functionality for truncating the simplex i.e. cutting off one or more corners of the triangle to save whitespace. This has been recently mentioned in #192 and as I've been working on this for some time locally, I thought I'd share this code. I have added an truncated_simplex_example.py to the examples folder which gives a basic tutorial. There are convenience functions for getting and setting the ticks and tick labels which remain after the truncation. Truncation works with or without having set custom axis data limits.
This works for scatter plots but has not been tested on any of the heatmap plots.