Skip to content
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

changed plotting return types #184

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bobmyhill
Copy link

This PR modifies the plot, plot_colored_trajectory, scatter and legend functions so that they return the object just created (rather than the whole ax object or nothing). This allows the user to access the attributes of the object more easily.

For example, to add a text label to a scatter point, one could do the following:

fig, ax = plt.subplots()
tax = ternary.TernaryAxesSubplot(ax=ax, scale=100)

d = tax.scatter([[20., 30., 50.]], c='k')
x, y = d.get_offsets().data[0]
ax.text(x+2., y, 'data point')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant