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 — pzmap(sys, grid=True) fails · Issue #458 · python-control/python-control

pzmap(sys, grid=True) fails #458

New issue
Copy link
New issue
Copy link
Closed
#456
Closed
pzmap(sys, grid=True) fails#458
#456
Copy link
Milestone
0.8.4

Description

@roryyorke
roryyorke
opened on Aug 21, 2020
Issue body actions

This is with 08d5e6c and matplotlib 3.3.0. I tried commenting out the offending line (the one calling angle_helper.ExtremeFinderCycle._adjust_extremes), and got an error deep in mpl_toolkit.

import control
g = control.tf(1, [1,1])
control.pzmap(g, grid=True)

Traceback:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-7-4e6a52bd77da> in <module>
      1 import control
      2 g = control.tf(1, [1,1])
----> 3 control.pzmap(g, grid=True)

~/src/python-control/control/pzmap.py in pzmap(sys, plot, grid, title, **kwargs)
    104                 ax, fig = zgrid()
    105             else:
--> 106                 ax, fig = sgrid()
    107         else:
    108             ax, fig = nogrid()

~/src/python-control/control/grid.py in sgrid()
     80     ax.axis[:].invert_ticklabel_direction()
     81 
---> 82     ax.axis["wnxneg"] = axis = ax.new_floating_axis(0, 180)
     83     axis.set_ticklabel_direction("-")
     84     axis.label.set_visible(False)

~/.miniconda3/envs/control-dev/lib/python3.8/site-packages/mpl_toolkits/axisartist/axislines.py in new_floating_axis(self, nth_coord, value, axis_direction)
    571     def new_floating_axis(self, nth_coord, value, axis_direction="bottom"):
    572         gh = self.get_grid_helper()
--> 573         axis = gh.new_floating_axis(nth_coord, value,
    574                                     axis_direction=axis_direction,
    575                                     axes=self)

~/.miniconda3/envs/control-dev/lib/python3.8/site-packages/mpl_toolkits/axisartist/grid_helper_curvelinear.py in new_floating_axis(self, nth_coord, value, axes, axis_direction)
    348             self, nth_coord, value, axis_direction)
    349 
--> 350         axisline = AxisArtist(axes, _helper)
    351 
    352         # _helper = FloatingAxisArtistHelper(self, nth_coord,

~/.miniconda3/envs/control-dev/lib/python3.8/site-packages/mpl_toolkits/axisartist/axis_artist.py in __init__(self, axes, helper, offset, axis_direction, **kwargs)
    744         self._axis_direction = axis_direction
    745 
--> 746         self._init_line()
    747         self._init_ticks(**kwargs)
    748         self._init_offsetText(axis_direction)

~/.miniconda3/envs/control-dev/lib/python3.8/site-packages/mpl_toolkits/axisartist/axis_artist.py in _init_line(self)
    885         if axisline_style is None:
    886             self.line = PathPatch(
--> 887                 self._axis_artist_helper.get_line(self.axes),
    888                 color=rcParams['axes.edgecolor'],
    889                 fill=False,

~/.miniconda3/envs/control-dev/lib/python3.8/site-packages/mpl_toolkits/axisartist/grid_helper_curvelinear.py in get_line(self, axes)
    268 
    269     def get_line(self, axes):
--> 270         self.update_lim(axes)
    271         x, y = self.grid_info["line_xy"]
    272 

~/.miniconda3/envs/control-dev/lib/python3.8/site-packages/mpl_toolkits/axisartist/grid_helper_curvelinear.py in update_lim(self, axes)
     99 
    100     def update_lim(self, axes):
--> 101         self.grid_helper.update_lim(axes)
    102 
    103         x1, x2 = axes.get_xlim()

~/.miniconda3/envs/control-dev/lib/python3.8/site-packages/mpl_toolkits/axisartist/axislines.py in update_lim(self, axes)
    325 
    326         if self._force_update or self._old_limits != (x1, x2, y1, y2):
--> 327             self._update(x1, x2, y1, y2)
    328             self._force_update = False
    329             self._old_limits = (x1, x2, y1, y2)

~/.miniconda3/envs/control-dev/lib/python3.8/site-packages/mpl_toolkits/axisartist/grid_helper_curvelinear.py in _update(self, x1, x2, y1, y2)
    317         if self.valid() and self._old_values == (x1, x2, y1, y2):
    318             return
--> 319         self._update_grid(x1, y1, x2, y2)
    320         self._old_values = (x1, x2, y1, y2)
    321         self._force_update = False

~/.miniconda3/envs/control-dev/lib/python3.8/site-packages/mpl_toolkits/axisartist/grid_helper_curvelinear.py in _update_grid(self, x1, y1, x2, y2)
    365 
    366     def _update_grid(self, x1, y1, x2, y2):
--> 367         self.grid_info = self.grid_finder.get_grid_info(x1, y1, x2, y2)
    368 
    369     def get_gridlines(self, which="major", axis="both"):

~/.miniconda3/envs/control-dev/lib/python3.8/site-packages/mpl_toolkits/axisartist/grid_finder.py in get_grid_info(self, x1, y1, x2, y2)
    102         """
    103 
--> 104         extremes = self.extreme_finder(self.inv_transform_xy, x1, y1, x2, y2)
    105 
    106         # min & max rage of lat (or lon) for each grid line will be drawn.

~/src/python-control/control/grid.py in __call__(self, transform_xy, x1, y1, x2, y2)
     42 
     43         lon_min, lon_max, lat_min, lat_max = \
---> 44             self._adjust_extremes(lon_min, lon_max, lat_min, lat_max)
     45 
     46         return lon_min, lon_max, lat_min, lat_max

AttributeError: 'ModifiedExtremeFinderCycle' object has no attribute '_adjust_extremes'

Activity

  1. roryyorke commented on Aug 21, 2020

    @roryyorke
    roryyorke
    on Aug 21, 2020
    ContributorAuthor
    More actions

    Oops, @bnavigator ahead of me with #456.

  2. roryyorke
    closed this as completedon Aug 21, 2020
  3. bnavigator
    reopened this on Aug 21, 2020
  4. bnavigator
    added this to the 0.8.4 milestone on Aug 21, 2020
  5. bnavigator
    linked a pull request that will close this issueFix pzmap grid (matplotlib angle_helper) #456on Aug 21, 2020
  6. bnavigator commented on Aug 21, 2020

    @bnavigator
    bnavigator
    on Aug 21, 2020
    Contributor
    More actions

    duplicate of #457

  7. bnavigator
    closed this as completedon Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      • 0.8.4

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — 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.