GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — root_locus() plot figure size issue - ipynotebook · Issue #464 · python-control/python-control

root_locus() plot figure size issue - ipynotebook #464

New issue
Copy link
New issue
Copy link
Closed
#503
Closed
root_locus() plot figure size issue - ipynotebook#464
#503
Copy link
Assignees
murrayrm
Labels
bug
Milestone
0.9.1

Description

@RicardoSQueen
RicardoSQueen
opened on Nov 3, 2020
Issue body actions

Hello,
I'm currently running python-control 0.8.3 on python 3.8.5.
When plotting 'root_locus' in a interactive python notebook, I get a plot way offset to the right, according to the image below:
image
The unexpected for me, though, is that when the exact same code was executed directly from the terminal, the plot was perfect.
The plot issues appears on every interactive notebook environment: jupyter notebook, jupyter lab and visual studio code's jupyter implementation. I'm running these versions of jupyter:
notebook 6.1.4
jupyter_client 6.1.7
jupyter_contrib_core 0.3.3
jupyter_core 4.6.3
jupyter_latex_envs 1.4.6
jupyterlab 2.2.8
jupyterlab_pygments 0.1.2
jupyterlab_server 1.2.0

here is the code for reproducing:

from control import *
import matplotlib.pyplot as plt

num = [25]
den = [1,6,25]
x1 = tf(num, den)
rlist, klist = root_locus(x1)
plt.show()

Activity

  1. sawyerbfuller commented on Nov 4, 2020

    @sawyerbfuller
    sawyerbfuller
    on Nov 4, 2020
    Contributor
    More actions

    Hi Ricardo, thanks for pointing out the issue. I think this has been fixed in #413 and is now in the dev branch (see screenshot below running the dev branch). Release 0.8.4 is right around the corner and includes these fixes. If you are able to run the dev branch (see instructions near the bottom of https://github.com/python-control/python-control), could you confirm whether or not the issue is still there for you?

    image

  2. RicardoSQueen commented on Nov 15, 2020

    @RicardoSQueen
    RicardoSQueen
    on Nov 15, 2020
    Author
    More actions

    Hey Sawyer,
    Sorry, I tried finding an issue related to my issue but I didn't find any.. oh well. Awesome to know that!
    I did install the dev branch over here and it seems that it's still not ok. Here are some screenshots:
    image
    image
    image
    The plot is all white to me.. And it took a little while (longer than usual)
    Running your code worked out great:
    image
    And I tried running the same transfer function (L2) but continuous and I got an error:
    image
    So there seems to be an issue in continuous transfer functions.. Below is the error message I got:
    ValueError: Image size of 1932716x278 pixels is too large. It must be less than 2^16 in each direction.
    And the full traceback is attached.
    traceback.txt

  3. bnavigator
    added
    bug
    on Nov 17, 2020
  4. murrayrm commented on Dec 26, 2020

    @murrayrm
    murrayrm
    on Dec 26, 2020
    Member
    More actions

    Confirming that I get results similar to @RicardoSQueen: when running the code at the top for reproducing the error, I am able to get a plot in ipython but not in a Jupyter notebook. The example that @sawyerbfuller gives works in both cases. This seems to be triggered by something we are doing in rlocus, but not clear that the fix is anything obvious.

    I don't think this this is something we can fix prior to release of 0.8.4, so pushing out to 0.9.x for now.

  5. murrayrm
    added this to the 0.9.x milestone on Dec 26, 2020
  6. murrayrm commented on Jan 9, 2021

    @murrayrm
    murrayrm
    on Jan 9, 2021
    Member
    More actions

    I chased down the problem (with lots of annoying sorting out what uncommented code was doing). The problem boiled down to labels for the constant natural frequency lines being annotated outside of the bounds of the plot. In python/ipython this seems to be handled OK, but in Jupyter notebooks it messes up the aspect ratio of the resulting plot. Final fix was just to check the location version the limits and supress the annotation. PR coming.

    Reacted by Ben Greiner and Joseph C. Slater
  7. murrayrm
    linked a pull request that will close this issuefix rlocus plotting problem in Jupyter notebooks + comments, PEP8 #503on Jan 9, 2021
  8. murrayrm
    added
    PR pending
    on Jan 9, 2021
  9. murrayrm
    self-assigned this
    on Jan 9, 2021
  10. murrayrm
    removed
    PR pending
    on Jan 9, 2021
  11. murrayrm
    closed this as completedin #503on Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @murrayrm
    murrayrm

Labels

bug

Type

No type

Projects

No projects

    Milestone

    • 0.9.1

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.