GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allow time_response_plot to plot a list of responses by raashish1601 · Pull Request #1254 · python-control/python-control

Conversation

@raashish1601

@raashish1601 raashish1601 commented Oct 7, 2026

Copy link
Copy Markdown

Fixes #1171.

time_response_plot() failed when given a list of responses, as in the issue:

resp1 = ct.input_output_response(sys, timepts, np.sin(timepts))
resp2 = ct.input_output_response(sys, timepts, np.cos(timepts))
ct.time_response_plot([resp1, resp2])  # AttributeError: 'list' object has no attribute 'plot_inputs'

A list (or tuple) is now handed to TimeResponseList.plot(), which plots the responses one after the other on the same axes, so the result is the same as resp1.plot(); resp2.plot() (the plot the issue describes as the desired one) and as ct.TimeResponseList([resp1, resp2]).plot(). All keyword arguments, *fmt and a list of labels are passed through. I did not change the color scheme discussed at the end of the issue; the colors are the same as with TimeResponseList.plot() today.

Added test_time_response_plot_list to control/tests/timeplot_test.py (the example from the issue with plot_inputs None, True, 'overlay' and False, compared line by line with TimeResponseList.plot()). It fails on main and passes here. timeplot_test.py, timeresp_test.py, ctrlplot_test.py, kwargs_test.py and docstrings_test.py pass locally (542 passed, 51 skipped), and ruff check is clean.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@raashish1601
Allow time_response_plot to plot a list of responses (fixes python-co…
c71a231
…ntrol#1171)
@slivingston

slivingston commented Oct 7, 2026

Copy link
Copy Markdown
Member

@raashish1601 Can you disclose if and how you used AI tools to do this work? (Please read the README section about contributing and in particular https://numpy.org/doc/stable/dev/ai_policy.html.)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@raashish1601 raashish1601 mentioned this pull request Oct 7, 2026
Use the time axis of transposed inputs in discrete-time forced_response #1255
Closed
@raashish1601 raashish1601 closed this Oct 7, 2026
@raashish1601

raashish1601 commented Oct 7, 2026

Copy link
Copy Markdown
Author

Closing, see #1255 (comment) and the reply below it: this was prepared with an AI coding agent, which the NumPy AI policy referenced in your README does not allow.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Bug in time_response_plot for multiple responses + improvements in input/output colors.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@raashish1601 @slivingston
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.