Repository navigation
Commit 8c4f022
fix(graphics): ignore sign of scalar in expand_dims, document reversed limits (#262)
A negative scalar passed to `expand_dims` (and so
`plotvol2`/`plotvol3`/`Animate`) gave reversed limits, e.g. `-3` -> `[3,
-3, 3, -3]`, silently inverting the axes. A scalar is symmetric about
zero, so the sign is now ignored via `abs()`.
For the 2/4/6 element forms no min < max check is added. Matplotlib
inverts an axis when given reversed limits, so this is a useful way to
flip an axis, and `expand_dims` is a pure function with no axes to call
`invert_xaxis()` on. The docstring now says so.
Adds `test_expand_dims`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>1 parent 0e60218 commit 8c4f022
2 files changed
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1759 | 1759 | | |
1760 | 1760 | | |
1761 | 1761 | | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
1762 | 1768 | | |
1763 | 1769 | | |
1764 | 1770 | | |
1765 | 1771 | | |
1766 | 1772 | | |
| 1773 | + | |
1767 | 1774 | | |
1768 | 1775 | | |
1769 | 1776 | | |
| |||
1773 | 1780 | | |
1774 | 1781 | | |
1775 | 1782 | | |
| 1783 | + | |
1776 | 1784 | | |
1777 | 1785 | | |
1778 | 1786 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
16 | 33 | | |
17 | 34 | | |
18 | 35 | | |
| |||
0 commit comments