Skip to content

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.

1 participant