Repository navigation
pzmap() function not work, zero not plotted #154
Description
Activity
Can you provide a code snippet that generates both errors? Thanks.
Hi Murray,
The control package is 0.7.0.
A simple test code used,tf = control.TransferFunction([1,1],[1,1,1]) control.pzmap(tf)
It reports,
TypeError Traceback (most recent call last)
in ()
1 tf = control.TransferFunction([1,1],[1,1,1])
----> 2 control.pzmap(tf)
3 # control.matlab.pzmap(tf)
4 # pole, zero = control.matlab.pzmap(tf_mindist)
5 plt.show()
TypeError: 'module' object is not callablecontrol.matlab.pzmap(tf) is working fine except that zeros are not shown.
In pzmap file,if len(zeros) > 0: plt.scatter(real(zeros), imag(zeros), s=50, marker='o', facecolors='none')
The zeros are shown after removing facecolors setting.
It seems the 2 pzmap functions are essentially the same one. Sorry I'm not coder and can't digg too much.
Thanks very much.
so, completing the example from above to include necessary imports and the
showcommand, we haveimport matplotlib.pyplot as plt import control tf = control.TransferFunction([1,1],[1,1,1]) control.pzmap(tf) plt.show()
I am able to reproduce the reported behavior of missing zero markers. My hypothesis is some previous version of Matplotlib included marker edges by default, so
facecolors='none'was sufficient to cause circle outlines. One way to achieve it now isif len(zeros) > 0: plt.scatter(real(zeros), imag(zeros), s=50, marker='o', facecolors='none', edgecolors='g')
regarding the
TypeErrorexception, I was not able to produce the error using the tip ofmasterbranch, whereas I can reproduce the error using the previous release version 0.7.0.@Fankbai context?
def polezero(): h= control.tf([2.27612463, -3.07696238, 2.10964293, -0.83921913],[1]) b = pzmap(h) plt.show() polezero()PR #193 addresses it
Fixed in PR #193.
For the same control.TransferFunction() sys, if I called with python version control.pzmap(), it reports that
If called control.matlab.pzmap() it does plot the poles but not zeros. I checked the code that when plotting zeros, facecolors is set to 'none'.
How can I change the color back? I think it's more reasonable to set a proper color for this line.
Thanks.