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

Set text label x-position in striplog axes #161

Open
EvanBianco opened this issue Jul 26, 2022 · 0 comments
Open

Set text label x-position in striplog axes #161

EvanBianco opened this issue Jul 26, 2022 · 0 comments

Comments

@EvanBianco
Copy link
Collaborator

Labels and descriptions should be plotted using the striplog axes object ax instead of plt.text(). In the case of multi axes plots, this may cause issues.

Also, we should allow the user to set the xposition of the text labels. Perhaps with an option to specify whether this is in data coordinates (which it is currently), or as a fraction of the x-axis (axis coordinates).

Currently an otherwise unspecified striplog will get a width of 1.5, so a label placement at 1.6 would correspond to a axis coordinate of 1.066. Using Axes coordinates could mean transforming the y-value from data coordinates (depth) into axes coordinates (0-1). So I'm not sure if that's unnecessarily complicated?

Relevant lines of code starts here.

plt.text(1.6,

To avoid cluttering strip.plot(), perhaps it's best done as another method, say strip.plot_text(ax, xpos, name, size, wrap_width) ?
i.e.
[ax.text(xpos, iv.middle, iv.primary['formation'], ha='left', va='center', size=10) for iv in w.data['strip']]

Thanks for raising this issue @DougiB!

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

No branches or pull requests

1 participant