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
Add Matplotlib magnetization coloring #597
Conversation
…into mpl-mag-color
@@ -39,6 +39,7 @@ | |||
from magpylib._src.display.traces_utility import merge_mesh3d | |||
from magpylib._src.display.traces_utility import merge_traces | |||
from magpylib._src.display.traces_utility import place_and_orient_model3d | |||
from magpylib._src.display.traces_utility import slice_mesh_from_colorscale |
Check notice
Code scanning / CodeQL
Cyclic import Note
magpylib._src.display.traces_utility
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main #597 +/- ##
==========================================
- Coverage 99.80% 99.68% -0.13%
==========================================
Files 54 54
Lines 6218 6296 +78
==========================================
+ Hits 6206 6276 +70
- Misses 12 20 +8
|
decision:
|
@OrtnerMichael, ready to merge |
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.
looks good ty.
we should think about making pyvista or plotly the default backend
Scope
When using the matplotlib library there is no straightforward way to plot color gradients properly in 3D. In this PR, a new set of utilities allows to plot the magnetization orientation over every magnet by slicing and retriangulate the underlying graphical mesh object.
Examples
This is how it looks like
- in jupyter notebook
Caveats
So far it is an opt-in behavior, and we need to decide if we make it the new default for the
matplotlib
backend.There are a few caveat though that will influence this decision:
This is how it looks so far:
Antialiasing OFF:
Antialiasing ON:
###Notes
Open Tasks
Please @OrtnerMichael try out the feature and help us make the decision on how to move forward ;)