-
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
Are the ticks oriented incorrectly? #31
Comments
The library uses the same convention as ggtern. Here's an example. There was a long discussion a few months back about how the ticks should work, and it's largely a matter of preference. See #13 and #18. You can change the orientation with the |
In the diagram you posted, start at the bottom right corner. Move left 0.2 and up-left 0.2. Then look along the up-right diagonal -- it points to 0.6. So I think the ticks are right from that perspective (but as I said above, it's not the only valid way to plot, just the default). |
I figured out how to read it with the aid of this site. At least for chemistry, I think the numbers on the axis in the following plot should stay as they are, but the ticks should be reoriented to go along with the respective colors. i.e. they are at the wrong angles. And, maybe the labels should be at the corner so we know that, at the top of this plot, is pure component 1... Is there another way to interpret this? |
You can pass Adding labels to the corners could be done easily, but it think the plot is clear already -- in the above plot y2 is zero in the bottom right corner, it's equal to one in the left corner. To add labels to the corner points just use the normal matplotlib labels at the appropriate coordinates, something like
I could add a convenience function |
I think you're right about the labels. I passed I made the colormap correspond to the uptake of a given component to check the tick labels. I modified
I can think of a cleaner way to do it if you are interested. |
I think that's a nice addition -- maybe just a tuple of colors (or even a namedtuple), something like:
Maybe it's a good idea to modify If that's too much to ask, please just post the code for your diagram and I'll write up a patch. Also, have you played with the alpha of your interior lines? I think that could improve your plot, and also perhaps increasing the offset for the boundary labels. The plot would make a nice addition to the examples in the readme. |
I also added a colorbar label for the heatmap and fixed the formatting so it isn't always multiplied by a scientific number (before, it was labeled 0.0 - 1.0 but had a 1e0 at the top to indicate it is a multiple of 1.0). So do you want me to modify master to change the tick colors and boundary colors, or will you do this? IMO, a dictionary is more popular; I have never heard of the namedtuple until now. Sure, once you decide on the syntax for changing the colors in the boundaries, ticks, tick labels, I will post my code and a simple function f(x, y, z) to make this example. |
A dictionary is fine. I'm happy to make the necessary changes, but even happier to merge a pull-request from you, since it's really your contribution / idea, and you'll get credit in the repository history. So if you have the time and inclination, go for it. Just fork the repository and push one or more commits to your master. When you are ready, open a pull-request. I will update the documentation appropriately. Otherwise please just post the sample code and I'll modify the master branch. |
Place your finger somewhere in the interior of the triangle. The way the ticks angle into the boundary of the triangle (the axes) suggests that the composition does not add up to 1.0... I think the ticks are oriented in incorrect angles. Am I right?
The text was updated successfully, but these errors were encountered: