Title: Use matplotlibs streamplot function for phase_plane_plot by lkies · Pull Request #1112 · python-control/python-control · GitHub
Open Graph Title: Use matplotlibs streamplot function for phase_plane_plot by lkies · Pull Request #1112 · python-control/python-control
X Title: Use matplotlibs streamplot function for phase_plane_plot by lkies · Pull Request #1112 · python-control/python-control
Description: WORK IN PROGRESS As the title says, phase_plane_plot currently creates streamlines by integrating a set of initial conditions forwards or backwards in time, while this allows for quite some flexibility it takes more work to get good looking results. Matplotlibs streamplot is basically made for things like this an produces good looking streamline plots from vector field data, it also makes it very easy to visualize the flows magnitude using varying line thickness or color. I added a subfunction phaseplot.streamplot and the corresponding argument plot_streamplot to phase_plane_plot. There are two options vary_linewidth and vary_color which will vary the linewidth or color depending on the magnitude, they both default to false. You can also pass a colormap or matplotlib norm to make the magnitude to the colors and thicknesses Some things of note that I am not quite happy with yet: Most of phase_plane_plot is built around the points to evaluate being specified in list, matplotlibs streamplot requires a rectangular grid however so the original grid needs to be recovered from the list of points which is a bit hacky. per documentation phase_plane_plot returns the artist from the individual subfunctions into an array of size 3, adding a fourth element to return the streamplot is technically a breaking change because the array could be used in a destructuring bind. Because of this I didn't add any means of returning the artist yet. by default the zorder of the separatrices is below the streamplot which looks a bit bad, but i didnt want to hardcode zorders and getting the zorder from one to set the other might be a bit overkill. Whats your opinion on these problems and what i need to do to get this merged?
Open Graph Description: WORK IN PROGRESS As the title says, phase_plane_plot currently creates streamlines by integrating a set of initial conditions forwards or backwards in time, while this allows for quite some flexibi...
X Description: WORK IN PROGRESS As the title says, phase_plane_plot currently creates streamlines by integrating a set of initial conditions forwards or backwards in time, while this allows for quite some flexibi...
Opengraph URL: https://github.com/python-control/python-control/pull/1112
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:4d44bfee-31c7-e273-e7f8-3304532b338e |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | E31A:166200:B11B:DC46:697A55C0 |
| html-safe-nonce | 096f8ebe1008cfc7ef0d73ed10b402fb547490fad1245b5f53f65de67ef9d986 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzFBOjE2NjIwMDpCMTFCOkRDNDY6Njk3QTU1QzAiLCJ2aXNpdG9yX2lkIjoiNTc3NTA4Njg4ODUyMzgxNDMzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 362b0c4f31ef3bccec84176d72634880d2caa47d4f19d4ae3ab44948e0721988 |
| hovercard-subject-tag | pull_request:2310926050 |
| 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/1112/checks |
| twitter:image | https://avatars.githubusercontent.com/u/43540048?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/43540048?s=400&v=4 |
| og:image:alt | WORK IN PROGRESS As the title says, phase_plane_plot currently creates streamlines by integrating a set of initial conditions forwards or backwards in time, while this allows for quite some flexibi... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | a2296221ffa83b7f45f8ba9b62e1aed869492cb43693309e51b8111607e38282 |
| turbo-cache-control | no-cache |
| 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 | 46d8a07df71eb59259545c68ce36abf1075d2fca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width