Title: I'm having problems with the `ax` parameters of the `rlocus` function · Issue #623 · python-control/python-control · GitHub
Open Graph Title: I'm having problems with the `ax` parameters of the `rlocus` function · Issue #623 · python-control/python-control
X Title: I'm having problems with the `ax` parameters of the `rlocus` function · Issue #623 · python-control/python-control
Description: I was trying today to plot the root locus of a transfer function, but wanted to pass a specific axes object to it, so I tried to use the ax parameter of the rlocus function: from control import * import matplotlib.pyplot as plt s = tf([1...
Open Graph Description: I was trying today to plot the root locus of a transfer function, but wanted to pass a specific axes object to it, so I tried to use the ax parameter of the rlocus function: from control import * i...
X Description: I was trying today to plot the root locus of a transfer function, but wanted to pass a specific axes object to it, so I tried to use the ax parameter of the rlocus function: from control import * i...
Opengraph URL: https://github.com/python-control/python-control/issues/623
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"I'm having problems with the `ax` parameters of the `rlocus` function","articleBody":"I was trying today to plot the root locus of a transfer function, but wanted to pass a specific axes object to it, so I tried to use the `ax` parameter of the `rlocus` function:\r\n\r\n```\r\nfrom control import *\r\nimport matplotlib.pyplot as plt\r\n\r\ns = tf([1, 0], 1)\r\nG = 1/(s*(s+1))\r\n\r\nfig, ax = plt.subplots(dpi=200)\r\nrlocus(G, ax=ax)\r\n```\r\n\r\nBut when doing this, the following error was raised:\r\n\r\n```\r\n---------------------------------------------------------------------------\r\nUnboundLocalError Traceback (most recent call last)\r\n\u003cipython-input-1-80498c4b1a54\u003e in \u003cmodule\u003e\r\n 6 \r\n 7 fig, ax = plt.subplots(dpi=200)\r\n----\u003e 8 rlocus(G, ax=ax)\r\n\r\n~\\anaconda3\\lib\\site-packages\\control\\rlocus.py in root_locus(sys, kvect, xlim, ylim, plotstr, plot, print_gain, grid, ax, **kwargs)\r\n 173 \r\n 174 if print_gain and not sisotool:\r\n--\u003e 175 fig.canvas.mpl_connect(\r\n 176 'button_release_event',\r\n 177 partial(_RLClickDispatcher, sys=sys, fig=fig,\r\n\r\nUnboundLocalError: local variable 'fig' referenced before assignment\r\n```\r\n\r\nControl version: 0.9.0 ","author":{"url":"https://github.com/jolenscki","@type":"Person","name":"jolenscki"},"datePublished":"2021-05-22T00:32:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/623/python-control/issues/623"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8edba8ef-9b82-b98a-e237-7193fca2eeac |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8106:F149B:179643:20E8C9:697B3E9B |
| html-safe-nonce | 431137cf60032a3250ff8ba4dd045aece5c6cb2d3cf66d9ca5e52d917750bafd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTA2OkYxNDlCOjE3OTY0MzoyMEU4Qzk6Njk3QjNFOUIiLCJ2aXNpdG9yX2lkIjoiODk2NzcwODAwMjg4NjU2NTUzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d92555089518d5418f0b60c8fa1c647440f64d2ef0e850be3cd9312e413fcf1b |
| hovercard-subject-tag | issue:898676768 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python-control/python-control/623/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1a8629043f20b5db26d34e7b02e76eab3ef64af14c5e78f7f511386fdae5ef2c/python-control/python-control/issues/623 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1a8629043f20b5db26d34e7b02e76eab3ef64af14c5e78f7f511386fdae5ef2c/python-control/python-control/issues/623 |
| og:image:alt | I was trying today to plot the root locus of a transfer function, but wanted to pass a specific axes object to it, so I tried to use the ax parameter of the rlocus function: from control import * i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jolenscki |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6fe64d94889230be19a900846cfc91707e7dd4206878d6c208922b46a6b0735d |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 15736a47b83581130a149aa1b928696bea06adde |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width