-
Notifications
You must be signed in to change notification settings - Fork 48
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
Improve plotting of vector labels #443
Improve plotting of vector labels #443
Conversation
Sorry @hakonanes, I should have reviewed this. Can I get it sometime next week once the conflicts (also my fault) have been resolved? |
No problem, sounds good! Will fix the conflicts. |
By 'no problem', I mean thanks for reviewing :) |
b322fa2
to
262dfe2
Compare
Conflicts fixed, should be ready for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay @hakonanes, this change looks great and will be helpful to users wanting to improve their figures. Would you mind if I make a very minor change to one of the notebooks just to add offset
to one of the plots?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, I'll check @harripj got his change in and then mege.
@pc494 feel free to merge! |
Great, thank you guys for having a look! Will merge once the Python 3.7 build succeeds. |
Signed-off-by: Håkon Wiik Ånes <[email protected]>
Signed-off-by: Håkon Wiik Ånes <[email protected]>
Signed-off-by: Håkon Wiik Ånes <[email protected]>
Signed-off-by: Håkon Wiik Ånes <[email protected]>
Signed-off-by: Håkon Wiik Ånes <[email protected]>
Signed-off-by: Håkon Wiik Ånes <[email protected]>
Signed-off-by: Håkon Wiik Ånes <[email protected]>
Signed-off-by: Håkon Wiik Ånes <[email protected]>
Signed-off-by: Håkon Wiik Ånes <[email protected]>
Signed-off-by: Håkon Wiik Ånes <[email protected]>
Signed-off-by: Håkon Wiik Ånes <[email protected]>
2f9640a
to
ed126e1
Compare
Description of the change
This PR improves plotting of vector labels in the stereographic projection by:
orix.plot.format_labels(v, brackets=("", ""), use_latex=True)
accepting an array of vectors and returning an array of strings, one integer label per vector.offset=None
parameter inStereographicPlot.text()
to control offset in stereographic coordinates (X, Y). When plotting withVector3d.scatter(..., vector_labels=labels)
, this offset can be passed viatext_kwargs={"offset": (0, 0.02)}"
.This makes labeling a pole figure much easier and nicer.
We can consider "extending" the
vector_labels
inMiller.scatter()
by allowing it to beTrue
, which then automatically creates the labels and adds them accordingly with the correct brackets (hkl/uvw). The danger is that this labeling assumes integer coordinates which might not be true for all vectors. If we add this, a warning should be raised in the case where rounding introduces an error in the coordinate labels above a certain threshold.Progress of the PR
Minimal example of the bug fix or new feature
Create three sets of direct lattice vectors <uvw> and plot them in the stereographic projection with labels and one color per family of directions
For reviewers
__init__.py
.section in
CHANGELOG.rst
.__credits__
inorix/__init__.py
and in.zenodo.json
.