Title: Time response plot improvements by murrayrm · Pull Request #1018 · python-control/python-control · GitHub
Open Graph Title: Time response plot improvements by murrayrm · Pull Request #1018 · python-control/python-control
X Title: Time response plot improvements by murrayrm · Pull Request #1018 · python-control/python-control
Description: This PR makes improvements to the code for plotting time responses, building on some of the improvements made for frequency response plots (#1011): Fix up the ax keyword processing to allow arrays or lists + uniform processing for all (time and frequency) plot routines. Slight refactoring of code to put common functions in ctrlplot.py (additional changes coming in future PR to further consolidate common code) Allow time responses for multiple systems with common time vector and inputs. This enables commands like ct.step_response([sys1, sys2]).plot to find a single time interval (before you had to call step_response twice and could get different default time intervals). Fix sequential plotting so that different colors are used and plot title is updated (like Bode and Nyquist). Allow label keyword in various time response commands to override default label generation. Allow legends to be turned on and off using show_legend keyword. Added a file examples/plot_gallery.py that generates a PDF file with some standard plots to compare changes in basic plotting between PRs and releases. To get a sense of the differences, consider the following code: sys_mimo1 = ct.tf2ss( [[[1], [0.1]], [[0.2], [1]]], [[[1, 0.6, 1], [1, 1, 1]], [[1, 0.4, 1], [1, 2, 1]]], name="sys_mimo1") sys_mimo2 = ct.tf2ss( [[[1], [0.1]], [[0.2], [1]]], [[[1, 0.2, 1], [1, 24, 22, 5]], [[1, 4, 16, 21], [1, 0.1]]], name="sys_mimo2") ct.step_response(sys_mimo1).plot() ct.step_response(sys_mimo2).plot() Prior to this PR, the output from this code was Note the fact that both responses are in the same color. With this PR, the output becomes Furthermore, you can compute a single time range using the command ct.step_response([sys_mimo1, sys_mimo2]) which gives a single time range for both systems:
Open Graph Description: This PR makes improvements to the code for plotting time responses, building on some of the improvements made for frequency response plots (#1011): Fix up the ax keyword processing to allow arrays...
X Description: This PR makes improvements to the code for plotting time responses, building on some of the improvements made for frequency response plots (#1011): Fix up the ax keyword processing to allow arrays...
Opengraph URL: https://github.com/python-control/python-control/pull/1018
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:3b392a18-0968-a3c9-f227-bc75030d52a8 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | AFBE:3BD318:2003EA5:2B136D9:697AB3A4 |
| html-safe-nonce | a01afcfe645f1bdef1974a6eaeffe13af2f17d6de854b69fdc44c30835029809 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkJFOjNCRDMxODoyMDAzRUE1OjJCMTM2RDk6Njk3QUIzQTQiLCJ2aXNpdG9yX2lkIjoiNDUzMTY1NTA5ODU0Njk1OTI2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9d7095963e1373c46467cfc09cb20691484b1e33dd9129b17111258ff36d6ac4 |
| hovercard-subject-tag | pull_request:1945696916 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python-control/python-control/pull/1018/checks |
| twitter:image | https://avatars.githubusercontent.com/u/293362?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/293362?s=400&v=4 |
| og:image:alt | This PR makes improvements to the code for plotting time responses, building on some of the improvements made for frequency response plots (#1011): Fix up the ax keyword processing to allow arrays... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 33acda8ebf71b04c9d33b494d2b6e0db48193ec89eb3ad92a9539d491fa9a3da |
| turbo-cache-control | no-preview |
| go-import | github.com/python-control/python-control git https://github.com/python-control/python-control.git |
| octolytics-dimension-user_id | 2285872 |
| octolytics-dimension-user_login | python-control |
| octolytics-dimension-repository_id | 22791752 |
| octolytics-dimension-repository_nwo | python-control/python-control |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 22791752 |
| octolytics-dimension-repository_network_root_nwo | python-control/python-control |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4f714a84d3384e467839505ed65f968fc01aedf1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width