Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

sisotool(sys) isn't ploting#770

Unanswered
eletroinf asked this question inQ&A
Sep 14, 2022· 2 comments· 1 reply
Discussion options

Hello
I'm trying python control, starting with the examples.
With this simple example:

from control.matlab import *
sys = tf([1000], [1,25,100,0])
sisotool(sys)

Located athttps://python-control.readthedocs.io/en/latest/generated/control.sisotool.html
What I understand is that it should generate a plot, but when I run the code from a python terminal nothing happens.
Running it from Anaconda spyder it generates a figure plot, what I think it is the correct behavior.

It wouldn't generate a figure when running in a terminal? (I'm using windows)

Regards
Ricardo

You must be logged in to vote

Replies: 2 comments 1 reply

Comment options

Hi,

Did you set up your interactive terminal to plot Matplotlib figures?
https://matplotlib.org/stable/users/explain/interactive.html

You must be logged in to vote
1 reply
@eletroinf
Comment options

Hi,
I'm trying to understand what you mean, but for me it doesn't make sense. pytplot isn't even imported in the example code. I think it is imported inside the control library. Documentation doesn't mention that it is needed to set pyplot.

Thank you anyway

Comment options

Hi all,
Just to close this issue, today I worked on it. One solution to this code to work is import pyplot and use the function plt.show() at the end.
By doing this, it will show a picture (I'm using Python 3.11).

import matplotlib.pyplot as plt
from control.matlab import *

sys = tf([1000], [1,25,100,0])
sisotool(sys)

plt.show()

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@eletroinf@bnavigator

[8]ページ先頭

©2009-2025 Movatter.jp