Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rqt_plot crashes when resizing the window #54

Closed
jonathan84clark opened this issue Apr 20, 2020 · 8 comments
Closed

rqt_plot crashes when resizing the window #54

jonathan84clark opened this issue Apr 20, 2020 · 8 comments

Comments

@jonathan84clark
Copy link

Steps to reproduce.

  1. Type rqt_plot in a terminal window
  2. Grab the bottom edge of the rqt_plot gui window with the mouse
  3. Drag to resize.

I get this error:
qurrent@qurrent-HP-Z820-Workstation:~/catkin_ws$ rqt_plot /vrx/debug/wind/speed Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5agg.py", line 77, in paintEvent self.resizeEvent(event) File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_plot/data_plot/mat_data_plot.py", line 110, in resizeEvent self.figure.tight_layout() File "/usr/lib/python2.7/dist-packages/matplotlib/figure.py", line 2031, in tight_layout self.subplots_adjust(**kwargs) File "/usr/lib/python2.7/dist-packages/matplotlib/figure.py", line 1881, in subplots_adjust self.subplotpars.update(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/matplotlib/figure.py", line 241, in update raise ValueError('bottom cannot be >= top') ValueError: bottom cannot be >= top

OS: Ubuntu 18.04
Version: ros-melodic-rqt is already the newest version (0.5.1-1bionic.20200320.111301)

Any help here would be great!

Thanks,

Jonathan L Clark

@floesche
Copy link

floesche commented May 3, 2020

Possibly related to this and #35, I see rqt_plot crashes for me on resize with python3.8, matplotlib-3.2.1, and ros2 eloquent. The error message I am seeing is:

Traceback (most recent call last):
  File "${ROS_WS}/install/rqt_plot/lib/python3.8/site-packages/rqt_plot/data_plot/mat_data_plot.py", line 109, in resizeEvent
    super(MatDataPlot.Canvas, self).resizeEvent(event)
  File "/usr/lib/python3.8/site-packages/matplotlib/backends/backend_qt5.py", line 397, in resizeEvent
    self.figure.set_size_inches(winch, hinch, forward=False)
  File "/usr/lib/python3.8/site-packages/matplotlib/figure.py", line 902, in set_size_inches
    raise ValueError(f'figure size must be positive finite not {size}')
ValueError: figure size must be positive finite not [9.33 0. ]

@robwaat
Copy link

robwaat commented May 13, 2020

I am also seeing the issue described by Johnathan with the following setup

  • OS: Ubuntu:18.04,
  • Package: ros-melodic-rqt bionic,now 0.5.1-1bionic.20200320.111301 amd64
  • Backend: matplotlib 2.1.1

The error message was:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5agg.py", line 77, in paintEvent
    self.resizeEvent(event)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_plot/data_plot/mat_data_plot.py", line 110, in resizeEvent
    self.figure.tight_layout()
  File "/usr/lib/python2.7/dist-packages/matplotlib/figure.py", line 2031, in tight_layout
    self.subplots_adjust(**kwargs)
  File "/usr/lib/python2.7/dist-packages/matplotlib/figure.py", line 1881, in subplots_adjust
    self.subplotpars.update(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/matplotlib/figure.py", line 241, in update
    raise ValueError('bottom cannot be >= top')
ValueError: bottom cannot be >= top

I found that a workaround is to right-click on the rqt_plot window banner and maximize the window. Then right click again and un-maximize. Afterwards, the rqt_plot no longer seems to crash upon resizing.

Setting the layout type to "tight" may also have had an effect, per advice in Issue #35.

This "fix" appears to persist across multiple re-launches.

@chill-nemesis
Copy link

After installing pyqtgraph via pip, rqt_plot is no longer crashing on resize (and is correctly displaying a graph at startup). I am still using the matplotlib interface for presentation.

@terlemez
Copy link

terlemez commented Sep 3, 2020

After installing pyqtgraph via pip, rqt_plot is no longer crashing on resize (and is correctly displaying a graph at startup). I am still using the matplotlib interface for presentation.

Thank you very much. This fixed the issue for me also!

@sergiosierram
Copy link

After installing pyqtgraph via pip, rqt_plot is no longer crashing on resize (and is correctly displaying a graph at startup). I am still using the matplotlib interface for presentation.

This also worked for me! I was running Ubuntu 18.04 and ROS melodic in a virtual machine in Oracle Virtual Box

@rhaschke
Copy link

rhaschke commented Feb 4, 2021

This is a duplicate of #35, which was actually fixed in #52 nearly a year ago, becoming part of release >= 0.4.11.
However, this fix is still not released into Kinetic (stuck at 0.4.8) or Melodic (stuck at 0.4.9).
@dirk-thomas: Could you please prepare new releases, such that rqt_plot works out of the box with the system-installed matplotlib? Thanks.
EDIT: Sorry Dirk, just noticed that maintainership was shifted to @mabelzhang just recently.
EDIT: #56 is related to this issue as well and provides an even more fundamental solution than #52.

rhaschke added a commit to rhaschke/rqt_plot that referenced this issue Feb 4, 2021
@rhaschke rhaschke mentioned this issue Feb 4, 2021
rhaschke added a commit to rhaschke/rqt_plot that referenced this issue Feb 5, 2021
@mabelzhang
Copy link
Contributor

mabelzhang commented Feb 23, 2021

ROS 1 branch with the fix in #69 is pending release to kinetic, melodic, and noetic. Will be in the next respective syncs.
ros/rosdistro#28396
ros/rosdistro#28397
ros/rosdistro#28398

I haven't looked at the ROS 2 fix yet but will try to soon.

@clalancette
Copy link
Contributor

This fix was released to ROS 1 quite a while ago, and I also just retested this on the latest ROS 2 Rolling. It seems to not occur there. With all of that said, I'm going to close this out, but please feel free to reopen if this is still occurring for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants