Skip to content

fix(plot): default to environment-managed Matplotlib display - #84

Open
huxiaoyi-ovo wants to merge 5 commits into
petercorke:mainfrom
huxiaoyi-ovo:fix/plot-block-contract-79
Open

huxiaoyi-ovo wants to merge 5 commits into
petercorke:mainfrom
huxiaoyi-ovo:fix/plot-block-contract-79

Conversation

@huxiaoyi-ovo

Copy link
Copy Markdown

Align plot() and highlight_path() with the RVC block contract without changing explicit True/False handling.

Co-Authored-By: ChatGPT (OpenAI GPT-6) noreply@openai.com

huxiaoyi-ovo and others added 4 commits October 19, 2026 12:54
Align plot() and highlight_path() with the RVC block contract without changing explicit True/False handling.

Co-Authored-By: ChatGPT (OpenAI GPT-6) <noreply@openai.com>
Co-Authored-By: ChatGPT (OpenAI GPT-6) <noreply@openai.com>
Co-Authored-By: ChatGPT (OpenAI GPT-6) <noreply@openai.com>
Co-Authored-By: ChatGPT (OpenAI GPT-6) <noreply@openai.com>
@codacy-production

codacy-production Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 7 complexity · 0 duplication

Metric Results
Complexity 7
Duplication 0

View in Codacy

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.

Co-Authored-By: ChatGPT (OpenAI GPT-6) <noreply@openai.com>
@petercorke

Copy link
Copy Markdown
Owner

Thank you for your interest in pgraph-python, and for this contribution. This brings plot() and highlight_path() in line with the block= contract used across the RVC toolboxes (None leaves display to the environment, False shows without waiting, True waits). RTB's planners already default to None, and PRMPlanner.plot in particular calls Graph.plot without a block, so it should now behave properly. The three-state tests are just what is needed.

I'm happy to take this as a deliberate behaviour change. Before merging, could you:

  1. Mark the change in the docstrings. Add a .. versionchanged:: 1.1 note to both plot() and highlight_path() saying the default changed from False to None, so plt.show() is no longer called unless block is given, and how to get the old behaviour (block=False).
  2. Add a CHANGELOG entry in a new Unreleased section at the top of the file (this will become 1.1.0), under a "Behaviour change" heading, naming who is affected: anyone who called g.plot() in a script or an IPython terminal (without %matplotlib or plt.ion()) and relied on a window appearing. They now need plt.show(), or block=False.
  3. Update the other docs and examples that show plotting: examples/roads.ipynb (it can drop its explicit block=None) and any runblock or other examples in docs/ that call plot() or highlight_path(). Please check that they still produce a figure.
  4. Link the issue and expand the description: please add Fixes #79 and say what the old behaviour was and what you changed.
  5. Test the other mix: plot() with the default followed by highlight_path(block=False), and plot(block=None, ax=...) with a caller-supplied axes.

Thanks again, and let me know if you'd rather I made any of these changes myself.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants