You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add units_length input to the show function (#786)
* draft
* add zoom by subplots, fix axes labeling
* fix empty subplots
* fix subplot ranges and animation
* fix zoom check
* fix labeling
* fix generic extra trace scaling
* fix extra non generic scaling
* pylint
* add cm and dm as units_length inputs
* fix ranges on non generic extra traces
* fix edge case range where no trace in subplot
* rework row cols conflicting inputs checks
* update github actions
* bump codeql actions versions
* fix checkout
* fix version
* update
* move to dev version
* add tests
* add docs entry
* fix typo in test
* pylint
* refactor
* fix autosize scaling with units
* ad units_length=None als option to remove axes labels
* fix axes label in parentheses
* remove old code
* refactor to allow units_length="auto"
* fix same color for different suplots
* remove unused variable (code ql)
* update changelog
* update docs
* fix collection subobj not being displayed
* fix collection precedence in show
* fix colorsquence on same obj in different subplot
* add color precedence tests
* set units_length default to "auto"
* fix line color matching 2D vs 3D
* refactor
* refactor
* add special case marker color to 2d traces
* refactor show_func
* fix different output units in 2d subplots
* pylint
* fix extra trace rescaling
* fix single to resize trace on different subplots
* fix rescaling when vertices are None instead fo np.nan
* fix pyvista streamlines example
* fix collection model3d not being displayed
* replace `np.NINF` with `-np.inf`
* pylint
* replace ´np.row_stack´ with `np.vstack`
* update changelog
* bump version
---------
Co-authored-by: Boisselet Alexandre (IFAT DC ATV SC D TE2) <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,8 @@
1
1
# Changelog
2
2
3
+
## [Unreleased] - YYYY-MM-DD
4
+
- Added `units_length` input to the `show` function to allow displaying axes with different length units. This parameter can be set individually for each subplot. ([#786](https://github.com/magpylib/magpylib/pull/786))
5
+
3
6
## [5.0.4] - 2024-06-18
4
7
- Add support for Numpy 2.0 ([#795](https://github.com/magpylib/magpylib/pull/789))
5
8
- Fix markers legend not being suppressible ([#795](https://github.com/magpylib/magpylib/pull/789))
Copy file name to clipboardExpand all lines: docs/_pages/user_guide/docs/docs_graphics.md
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ jupytext:
4
4
extension: .md
5
5
format_name: myst
6
6
format_version: 0.13
7
-
jupytext_version: 1.16.0
7
+
jupytext_version: 1.16.1
8
8
kernelspec:
9
-
display_name: Python 3
9
+
display_name: Python 3 (ipykernel)
10
10
language: python
11
11
name: python3
12
12
orphan: true
@@ -422,3 +422,23 @@ with magpy.show_context(loop, sens, animation=True) as sc:
422
422
sc.show(output=["Hx", "Hy", "Hz"], row=2)
423
423
sc.show(output="Hxyz", col=2, row=2)
424
424
```
425
+
426
+
### Canvas length units
427
+
428
+
When displaying very small Magpylib objects, the axes scaling in meters might be inadequate and you may want to use other units that fit the system dimensions more nicely. The example below shows how to display an object (in this case the same) with different length units and zoom levels.
429
+
430
+
```{tip}
431
+
Setting `units_length="auto"` will infer the most suitable units based on the maximum range of the system.
0 commit comments