Skip to content

pzmap() function not work, zero not plotted #154

Description

@elviseno

For the same control.TransferFunction() sys, if I called with python version control.pzmap(), it reports that

TypeError: 'module' object is not callable

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.

Activity

  1. murrayrm commented on Aug 8, 2017

    @murrayrm
    Member

    Can you provide a code snippet that generates both errors? Thanks.

  2. elviseno commented on Aug 9, 2017

    @elviseno
    Author

    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 callable

    control.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.

  3. slivingston commented on Aug 9, 2017

    @slivingston
    Member

    so, completing the example from above to include necessary imports and the show command, we have

    import matplotlib.pyplot as plt
    import control
    
    tf = control.TransferFunction([1,1],[1,1,1])
    control.pzmap(tf)
    plt.show()
  4. slivingston commented on Aug 9, 2017

    @slivingston
    Member

    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 is

    if len(zeros) > 0:
        plt.scatter(real(zeros), imag(zeros), s=50, marker='o',
                    facecolors='none', edgecolors='g')
  5. self-assigned this
    on Aug 9, 2017
  6. slivingston commented on Aug 9, 2017

    @slivingston
    Member

    regarding the TypeError exception, I was not able to produce the error using the tip of master branch, whereas I can reproduce the error using the previous release version 0.7.0.

  7. slivingston commented on Aug 16, 2017

    @slivingston
    Member

    @Fankbai context?

  8. Fankbai commented on Aug 26, 2017

    @Fankbai

    @slivingston

    def polezero(): 
            h= control.tf([2.27612463, -3.07696238,  2.10964293, -0.83921913],[1])
            b = pzmap(h)	
    	plt.show()
    polezero()
    
  9. Sup3rGeo commented on Feb 22, 2018

    @Sup3rGeo

    PR #193 addresses it

  10. added this to the 0.8.2 milestone on Jul 18, 2018
  11. murrayrm commented on Dec 28, 2018

    @murrayrm
    Member

    Fixed in PR #193.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions