Repository navigation
feat(plot): view="xy", "xz" or "yz" starts a PyPlot plot in an axis-aligned view of a plane - #879
Merged
Merged
Conversation
…ligned view of a plane PyPlot.launch(), robot.plot() and robot.teach() take view. It sets the starting view with view_init and nothing locks it: the plot can still be rotated, and animation does not reset it. The first axis of the plane is to the right and the second is up, in the orthographic projection that PyPlot already uses. A bad name raises ValueError before a figure is made, and a backend that cannot set a view (PyPlot2, Swift) says so. With env= it sets the view of the scene that is added to. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
petercorke
enabled auto-merge (squash)
October 21, 2026 21:34
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 21 high |
🟢 Metrics 51 complexity · 2 duplication
Metric Results Complexity 51 Duplication 2
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Merged
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #879 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 146 146
Lines 17068 17096 +28
=====================================
- Misses 17068 17096 +28 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
view="xy","xz"or"yz"starts a PyPlot plot in an axis-aligned, orthographic view of a plane, the first axis to the right and the second up. Forplot()and forteach().PyPlot.launch(view=),robot.plot(view=)androbot.teach(view=). It sets the starting view withview_init; nothing locks it, so the plot can be dragged to any other view, and a trajectory does not reset it.None(default) is the usual three-dimensional view. Names are case-insensitive.plot(env=...)(feat(plot): plot(env=) adds a robot to an earlier scene in a pose of its own, plot(ax=) draws on given axes, and color= sets the color #873) it sets the view of the scene that is added to.ValueErrorlisting the choices, before a figure is made. A backend that cannot set a view (PyPlot2, Swift) raisesValueErrorsaying so.plane_view(name)andset_plane_view(ax, name)intools/plot.py.rollis not passed (all the views use zero, the default), sincerollneeds Matplotlib 3.6 and the minimum version is not pinned.tests/test_plot_view.py, 43): the angles; that each view really has the first axis to the right and the second up, with the third end-on, by projecting the world axes; launch, plot, teach,ax=andenv=; the default unchanged; the view surviving a trajectory and a user rotation; and the errors, including that no figure is left behind.Not done: the axis that is end-on keeps its tick labels, which overlap in the corner of a flat view (cosmetic, Matplotlib's behaviour). Hiding them would be a follow-up.
Changes public behaviour: new argument only; nothing changes without it.
Ran: the full test suite (all pass except the 20 known
test_servo_half_turnfailures from a stale compiled extension in my worktree) and mypy (clean, 165 files); rendered the three views of a Puma 560 and checked them by eye. Not run: the docs build, andteachon a real display (the tests use Agg).Written with Claude Code.
🤖 Generated with Claude Code